mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-07-31 16:37:29 +02:00
chore: remove prettier to not conflict with biome
This commit is contained in:
+21
-21
@@ -63,7 +63,7 @@ export default function Home() {
|
||||
|
||||
try {
|
||||
const profileList = await invoke<BrowserProfile[]>(
|
||||
"list_browser_profiles"
|
||||
"list_browser_profiles",
|
||||
);
|
||||
setProfiles(profileList);
|
||||
|
||||
@@ -94,7 +94,7 @@ export default function Home() {
|
||||
() => {
|
||||
void checkForUpdates();
|
||||
},
|
||||
30 * 60 * 1000
|
||||
30 * 60 * 1000,
|
||||
);
|
||||
|
||||
return () => {
|
||||
@@ -107,7 +107,7 @@ export default function Home() {
|
||||
|
||||
try {
|
||||
const shouldShow = await invoke<boolean>(
|
||||
"should_show_settings_on_startup"
|
||||
"should_show_settings_on_startup",
|
||||
);
|
||||
if (shouldShow) {
|
||||
setSettingsDialogOpen(true);
|
||||
@@ -122,7 +122,7 @@ export default function Home() {
|
||||
|
||||
try {
|
||||
const hasStartupUrl = await invoke<boolean>(
|
||||
"check_and_handle_startup_url"
|
||||
"check_and_handle_startup_url",
|
||||
);
|
||||
if (hasStartupUrl) {
|
||||
console.log("Handled startup URL successfully");
|
||||
@@ -155,10 +155,10 @@ export default function Home() {
|
||||
await listen<string>("show-create-profile-dialog", (event) => {
|
||||
console.log(
|
||||
"Received show create profile dialog request:",
|
||||
event.payload
|
||||
event.payload,
|
||||
);
|
||||
setError(
|
||||
"No profiles available. Please create a profile first before opening URLs."
|
||||
"No profiles available. Please create a profile first before opening URLs.",
|
||||
);
|
||||
setCreateProfileDialogOpen(true);
|
||||
});
|
||||
@@ -180,7 +180,7 @@ export default function Home() {
|
||||
} catch (error: unknown) {
|
||||
console.log(
|
||||
"Smart URL opening failed or requires profile selection:",
|
||||
error
|
||||
error,
|
||||
);
|
||||
|
||||
// Show profile selector for manual selection
|
||||
@@ -216,7 +216,7 @@ export default function Home() {
|
||||
setError(`Failed to update proxy settings: ${JSON.stringify(err)}`);
|
||||
}
|
||||
},
|
||||
[currentProfileForProxy, loadProfiles]
|
||||
[currentProfileForProxy, loadProfiles],
|
||||
);
|
||||
|
||||
const handleCreateProfile = useCallback(
|
||||
@@ -235,7 +235,7 @@ export default function Home() {
|
||||
name: profileData.name,
|
||||
browserStr: profileData.browserStr,
|
||||
version: profileData.version,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Update proxy if provided
|
||||
@@ -249,16 +249,16 @@ export default function Home() {
|
||||
await loadProfiles();
|
||||
} catch (error) {
|
||||
setError(
|
||||
`Failed to create profile: ${error instanceof Error ? error.message : String(error)}`
|
||||
`Failed to create profile: ${error instanceof Error ? error.message : String(error)}`,
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
[loadProfiles]
|
||||
[loadProfiles],
|
||||
);
|
||||
|
||||
const [runningProfiles, setRunningProfiles] = useState<Set<string>>(
|
||||
new Set()
|
||||
new Set(),
|
||||
);
|
||||
|
||||
const runningProfilesRef = useRef<Set<string>>(new Set());
|
||||
@@ -290,7 +290,7 @@ export default function Home() {
|
||||
console.error("Failed to check browser status:", err);
|
||||
}
|
||||
},
|
||||
[isClient]
|
||||
[isClient],
|
||||
);
|
||||
|
||||
const launchProfile = useCallback(
|
||||
@@ -305,12 +305,12 @@ export default function Home() {
|
||||
"is_browser_disabled_for_update",
|
||||
{
|
||||
browser: profile.browser,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (isDisabled || isUpdating(profile.browser)) {
|
||||
setError(
|
||||
`${profile.browser} is currently being updated. Please wait for the update to complete.`
|
||||
`${profile.browser} is currently being updated. Please wait for the update to complete.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ export default function Home() {
|
||||
try {
|
||||
const updatedProfile = await invoke<BrowserProfile>(
|
||||
"launch_browser_profile",
|
||||
{ profile }
|
||||
{ profile },
|
||||
);
|
||||
await loadProfiles();
|
||||
await checkBrowserStatus(updatedProfile);
|
||||
@@ -330,7 +330,7 @@ export default function Home() {
|
||||
setError(`Failed to launch browser: ${JSON.stringify(err)}`);
|
||||
}
|
||||
},
|
||||
[loadProfiles, checkBrowserStatus, isUpdating, isClient]
|
||||
[loadProfiles, checkBrowserStatus, isUpdating, isClient],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -369,7 +369,7 @@ export default function Home() {
|
||||
setError(`Failed to delete profile: ${JSON.stringify(err)}`);
|
||||
}
|
||||
},
|
||||
[loadProfiles]
|
||||
[loadProfiles],
|
||||
);
|
||||
|
||||
const handleRenameProfile = useCallback(
|
||||
@@ -384,7 +384,7 @@ export default function Home() {
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
[loadProfiles]
|
||||
[loadProfiles],
|
||||
);
|
||||
|
||||
const handleKillProfile = useCallback(
|
||||
@@ -398,7 +398,7 @@ export default function Home() {
|
||||
setError(`Failed to kill browser: ${JSON.stringify(err)}`);
|
||||
}
|
||||
},
|
||||
[loadProfiles]
|
||||
[loadProfiles],
|
||||
);
|
||||
|
||||
// Don't render anything until we're on the client side to prevent hydration issues
|
||||
@@ -544,7 +544,7 @@ export default function Home() {
|
||||
isOpen={true}
|
||||
onClose={() => {
|
||||
setPendingUrls((prev) =>
|
||||
prev.filter((u) => u.id !== pendingUrl.id)
|
||||
prev.filter((u) => u.id !== pendingUrl.id),
|
||||
);
|
||||
}}
|
||||
url={pendingUrl.url}
|
||||
|
||||
Reference in New Issue
Block a user