mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-05-01 16:17:55 +02:00
fix: always disable browser while it is updating
This commit is contained in:
@@ -833,6 +833,7 @@ export default function Home() {
|
||||
);
|
||||
}}
|
||||
url={pendingUrl.url}
|
||||
isUpdating={isUpdating}
|
||||
runningProfiles={runningProfiles}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user