From 2f35d700ecf46dc6ec6064d55890d0512bb25115 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Tue, 2 Sep 2025 05:15:06 -0400 Subject: [PATCH] Win32Updater: Filtering --- src/main/patchWin32Updater.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/patchWin32Updater.ts b/src/main/patchWin32Updater.ts index 7c3f1dc30..b0648d3c8 100644 --- a/src/main/patchWin32Updater.ts +++ b/src/main/patchWin32Updater.ts @@ -37,11 +37,9 @@ function patchLatest() { const currentVersion = basename(currentAppPath); const discordPath = join(currentAppPath, ".."); - const latestVersion = readdirSync(discordPath).reduce((prev, curr) => { - return (curr.startsWith("app-") && isNewer(curr, prev)) - ? curr - : prev; - }, currentVersion as string); + const latestVersion = readdirSync(discordPath) + .filter(name => name.startsWith("app-") && statSync(join(discordPath, name)).isDirectory()) + .reduce((prev, curr) => isNewer(curr, prev) ? curr : prev, currentVersion as string); if (latestVersion === currentVersion) return;