refactor: update profile storage structure

This commit is contained in:
zhom
2025-07-03 21:34:56 +04:00
parent eea227d853
commit 341751c9b2
9 changed files with 538 additions and 231 deletions
+12
View File
@@ -33,6 +33,7 @@ import { usePermissions } from "@/hooks/use-permissions";
import { useUpdateNotifications } from "@/hooks/use-update-notifications";
import { useVersionUpdater } from "@/hooks/use-version-updater";
import { showErrorToast } from "@/lib/toast-utils";
import { sleep } from "@/lib/utils";
import type { BrowserProfile, ProxySettings } from "@/types";
type BrowserTypeString =
@@ -174,6 +175,17 @@ export default function Home() {
);
setProfiles(profileList);
// TODO: remove after a few version bumps, needed to properly display migrated profiles
setTimeout(async () => {
for (let i = 0; i < 10; i++) {
const profiles = await invoke<BrowserProfile[]>(
"list_browser_profiles",
);
setProfiles(profiles);
}
await sleep(500);
}, 0);
// Check for updates after loading profiles
await checkForUpdates();
await checkMissingBinaries();
+4
View File
@@ -4,3 +4,7 @@ import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}