This commit is contained in:
2025-12-27 16:57:19 +02:00
parent 5bfdd7dd2b
commit 331ff6daf3
31 changed files with 1049 additions and 429 deletions

View File

@@ -0,0 +1,30 @@
type DownloadDialogState = {
isOpen: boolean;
url: string | null;
};
let state: DownloadDialogState = { isOpen: false, url: null };
const listeners = new Set<() => void>();
function emit() {
listeners.forEach((l) => l());
}
export function subscribeDownloadDialog(listener: () => void) {
listeners.add(listener);
return () => listeners.delete(listener);
}
export function getDownloadDialogState() {
return state;
}
export function openDownloadDialog(url: string | null) {
state = { isOpen: true, url };
emit();
}
export function closeDownloadDialog() {
state = { isOpen: false, url: null };
emit();
}