From 45314620e4b51048e64b948620ca410ba1764651 Mon Sep 17 00:00:00 2001 From: Fazri Gading Date: Mon, 26 Jan 2026 02:16:33 +0800 Subject: [PATCH] fix: Discord ID int to str, duplicate run of cleanupDiscordRPC function, and dismiss setTimeout on discordRPC destroy --- main.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/main.js b/main.js index 2a856ad..697095c 100644 --- a/main.js +++ b/main.js @@ -30,7 +30,7 @@ let mainWindow; let discordRPC = null; // Discord Rich Presence setup -const DISCORD_CLIENT_ID = 1462244937868513373; +const DISCORD_CLIENT_ID = "1462244937868513373"; function initDiscordRPC() { try { @@ -372,14 +372,9 @@ function cleanupDiscordRPC() { try { console.log('Cleaning up Discord RPC...'); discordRPC.clearActivity(); - setTimeout(() => { - try { - discordRPC.destroy(); - } catch (error) { - console.log('Error during final Discord RPC cleanup:', error.message); - } - }, 100); + discordRPC.destroy(); discordRPC = null; + console.log('Discord RPC cleaned up successfully'); } catch (error) { console.log('Error cleaning up Discord RPC:', error.message); discordRPC = null; @@ -394,9 +389,6 @@ app.on('before-quit', () => { app.on('window-all-closed', () => { console.log('=== LAUNCHER CLOSING ==='); - - cleanupDiscordRPC(); - app.quit(); });