Fixed DiscordRPC crashing the app on startup if you didn't have discord open.

This commit is contained in:
2025-11-22 22:52:35 -05:00
parent 75e695ceea
commit 1d10083b86
3 changed files with 7 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "waifu-board", "name": "waifu-board",
"version": "v1.6.0", "version": "v1.6.1",
"description": "An image board app to store and browse your favorite waifus!", "description": "An image board app to store and browse your favorite waifus!",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@@ -55,6 +55,10 @@ function initDiscordRPC() {
}, 1000); }, 1000);
}); });
rpcClient.on('error', (err) => {
console.log('[Discord RPC] Background warning:', err.message);
});
rpcClient.on('disconnected', () => { rpcClient.on('disconnected', () => {
if (!app.isPackaged) { if (!app.isPackaged) {
console.log('Discord RPC: Disconnected. Attempting to reconnect in 10s...'); console.log('Discord RPC: Disconnected. Attempting to reconnect in 10s...');
@@ -69,6 +73,7 @@ function initDiscordRPC() {
try { try {
rpcClient.connect().catch(err => { rpcClient.connect().catch(err => {
console.error('Discord RPC: Connection failed', err.message); console.error('Discord RPC: Connection failed', err.message);
return;
}); });
} catch (err) { } catch (err) {
console.error('Discord RPC: Error initializing', err); console.error('Discord RPC: Error initializing', err);

View File

@@ -1,6 +1,6 @@
const GITHUB_OWNER = 'ItsSkaiya'; const GITHUB_OWNER = 'ItsSkaiya';
const GITHUB_REPO = 'WaifuBoard'; const GITHUB_REPO = 'WaifuBoard';
const CURRENT_VERSION = 'v1.6.0'; const CURRENT_VERSION = 'v1.6.1';
const UPDATE_CHECK_INTERVAL = 5 * 60 * 1000; const UPDATE_CHECK_INTERVAL = 5 * 60 * 1000;
let currentVersionDisplay; let currentVersionDisplay;