From 57441a88725c679ccce4cefae6a5aad8d8b33666 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Fri, 27 Mar 2026 12:45:29 -0700 Subject: [PATCH] Close popup & notify on download finish --- src/app/layout.tsx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b2bfa68..b23f618 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -692,6 +692,32 @@ export default function RootLayout ({ })() }, [serverVersionList, downloadedVersionsConfig, downloadVersions]) + useEffect(() => { + if ( + downloadProgress.length === 0 && + downloadQueue.length === 0 && + showPopup && + popupMode === 1 + ) { + setTimeout(async () => { + if (notificationsAllowed) { + await notifyUser('Downloads Complete', 'All downloads finished!') + } + await getCurrentWindow().requestUserAttention( + UserAttentionType.Informational + ) + closePopup() + }, 0) + } + }, [ + downloadProgress, + downloadQueue, + showPopup, + popupMode, + closePopup, + notificationsAllowed + ]) + useEffect(() => { if (!settings) return const unlisteners: Promise<() => void>[] = []