fix: properly track download progress

This commit is contained in:
zhom
2026-03-02 06:02:12 +04:00
parent 4a56575dbd
commit a723c8b30b
2 changed files with 16 additions and 11 deletions
+5 -4
View File
@@ -179,7 +179,7 @@ export function CreateProfileDialog({
downloadBrowser,
loadDownloadedVersions,
isVersionDownloaded,
downloadedVersions,
downloadedVersionsMap,
} = useBrowserDownload();
const loadSupportedBrowsers = useCallback(async () => {
@@ -344,8 +344,9 @@ export function CreateProfileDialog({
if (bestVersion && isVersionDownloaded(bestVersion.version)) {
return bestVersion;
}
if (downloadedVersions.length > 0) {
const fallbackVersion = downloadedVersions[0];
const browserDownloaded = downloadedVersionsMap[browserType ?? ""] ?? [];
if (browserDownloaded.length > 0) {
const fallbackVersion = browserDownloaded[0];
const releaseType =
browserType === "firefox-developer" ? "nightly" : "stable";
return {
@@ -355,7 +356,7 @@ export function CreateProfileDialog({
}
return null;
},
[getBestAvailableVersion, isVersionDownloaded, downloadedVersions],
[getBestAvailableVersion, isVersionDownloaded, downloadedVersionsMap],
);
const handleDownload = async (browserStr: string) => {