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>[] = []