refactor: sync

This commit is contained in:
zhom
2026-02-20 07:22:42 +04:00
parent 8bc1ea500b
commit 4872dcc8ad
28 changed files with 678 additions and 72 deletions
+21
View File
@@ -273,6 +273,17 @@ export function useBrowserDownload() {
const progress = event.payload;
setDownloadProgress(progress);
if (
progress.stage === "downloading" ||
progress.stage === "extracting" ||
progress.stage === "verifying"
) {
setDownloadingBrowsers((prev) => {
if (prev.has(progress.browser)) return prev;
return new Set(prev).add(progress.browser);
});
}
const browserName = getBrowserDisplayName(progress.browser);
if (progress.stage === "downloading") {
@@ -311,11 +322,21 @@ export function useBrowserDownload() {
} else if (progress.stage === "verifying") {
showDownloadToast(browserName, progress.version, "verifying");
} else if (progress.stage === "cancelled") {
setDownloadingBrowsers((prev) => {
const next = new Set(prev);
next.delete(progress.browser);
return next;
});
dismissToast(
`download-${browserName.toLowerCase()}-${progress.version}`,
);
setDownloadProgress(null);
} else if (progress.stage === "completed") {
setDownloadingBrowsers((prev) => {
const next = new Set(prev);
next.delete(progress.browser);
return next;
});
// On completion, refresh the downloaded versions for this browser and also refresh camoufox,
// since the Create dialog implicitly uses camoufox on the anti-detect tab
try {
+1 -1
View File
@@ -174,7 +174,7 @@ export function useBrowserState(
if (isCrossOsProfile(profile) && profile.host_os) {
const osName = getOSDisplayName(profile.host_os);
return `Created on ${osName}. Can only be launched on ${osName}.`;
return `This profile was created on ${osName} and is not supported on this system`;
}
const isRunning = runningProfiles.has(profile.id);