From 4b039c9b798cf87f22316ee5a3ac7dd0e504842b Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Tue, 3 Nov 2026 19:03:58 +0100 Subject: [PATCH] fix(workshop): keep download progress across tab switches The workshop is unmounted when the Installed tab is opened, so its local download state was discarded and returning to the Community tab showed no progress even though the install was still running. Active downloads and percentages now live in a shared module that outlives the component, and in-flight downloads keep updating it. --- src/lib/communityThemeDownloads.ts | 10 +++ .../theme/CommunityWorkshopView.svelte | 67 +++++++++++-------- 2 files changed, 49 insertions(+), 28 deletions(-) create mode 100644 src/lib/communityThemeDownloads.ts diff --git a/src/lib/communityThemeDownloads.ts b/src/lib/communityThemeDownloads.ts new file mode 100644 index 0000000..3da3b6c --- /dev/null +++ b/src/lib/communityThemeDownloads.ts @@ -0,0 +1,10 @@ +import { SvelteMap, SvelteSet } from 'svelte/reactivity'; + +/** + * Install progress lives outside the workshop component because switching to + * the Installed tab unmounts it. Keeping the state here lets the workshop show + * the current progress again when it is remounted, while the in-flight + * download keeps running. + */ +export const activeThemeDownloads = new SvelteSet(); +export const themeDownloadProgress = new SvelteMap(); diff --git a/src/lib/components/theme/CommunityWorkshopView.svelte b/src/lib/components/theme/CommunityWorkshopView.svelte index b964299..14e42ba 100644 --- a/src/lib/components/theme/CommunityWorkshopView.svelte +++ b/src/lib/components/theme/CommunityWorkshopView.svelte @@ -1,5 +1,6 @@