fix: always disable browser while it is updating

This commit is contained in:
zhom
2025-07-31 22:40:34 +04:00
parent 5b31cfaf32
commit f4c33ad96e
4 changed files with 8 additions and 4 deletions
+1
View File
@@ -833,6 +833,7 @@ export default function Home() {
);
}}
url={pendingUrl.url}
isUpdating={isUpdating}
runningProfiles={runningProfiles}
/>
))}
+2 -2
View File
@@ -68,7 +68,7 @@ interface ProfilesDataTableProps {
onChangeVersion: (profile: BrowserProfile) => void;
onConfigureCamoufox?: (profile: BrowserProfile) => void;
runningProfiles: Set<string>;
isUpdating?: (browser: string) => boolean;
isUpdating: (browser: string) => boolean;
onReloadProxyData?: () => void | Promise<void>;
onDeleteSelectedProfiles?: (profileNames: string[]) => Promise<void>;
onAssignProfilesToGroup?: (profileNames: string[]) => void;
@@ -87,7 +87,7 @@ export function ProfilesDataTable({
onChangeVersion,
onConfigureCamoufox,
runningProfiles,
isUpdating = () => false,
isUpdating,
onDeleteSelectedProfiles: _onDeleteSelectedProfiles,
onAssignProfilesToGroup,
selectedGroupId,
+3 -1
View File
@@ -34,6 +34,7 @@ import type { BrowserProfile, StoredProxy } from "@/types";
interface ProfileSelectorDialogProps {
isOpen: boolean;
onClose: () => void;
isUpdating: (browser: string) => boolean;
url?: string;
runningProfiles?: Set<string>;
}
@@ -43,6 +44,7 @@ export function ProfileSelectorDialog({
onClose,
url,
runningProfiles = new Set(),
isUpdating,
}: ProfileSelectorDialogProps) {
const [profiles, setProfiles] = useState<BrowserProfile[]>([]);
const [selectedProfile, setSelectedProfile] = useState<string | null>(null);
@@ -51,7 +53,7 @@ export function ProfileSelectorDialog({
const [storedProxies, setStoredProxies] = useState<StoredProxy[]>([]);
// Use shared browser state hook
const browserState = useBrowserState(profiles, runningProfiles);
const browserState = useBrowserState(profiles, runningProfiles, isUpdating);
// Helper function to check if a profile has a proxy
const hasProxy = useCallback(
+2 -1
View File
@@ -1,5 +1,6 @@
import { invoke } from "@tauri-apps/api/core";
import { useCallback, useEffect, useState } from "react";
import { getBrowserDisplayName } from "@/lib/browser-utils";
import type { BrowserProfile } from "@/types";
export function useBrowserSupport() {
@@ -168,7 +169,7 @@ export function useBrowserState(
}
if (isBrowserUpdating) {
return `${profile.browser} is being updated. Please wait for the update to complete.`;
return `${getBrowserDisplayName(profile.browser)} is being updated. Please wait for the update to complete.`;
}
if (