From 8f0d86f7bbdb39bba97d7e26de867fa444a6d489 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Wed, 24 Jun 2020 20:27:50 -0700 Subject: discord rpc is optional, v1.2.1 - also fix large image bug where sometimes it would not display - remove un-needed `async` from `setActivity` function --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 63f871e..3955227 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ 'use strict'; const path = require('path'); -const { app, BrowserWindow, Menu, session } = require('electron'); +const { app, BrowserWindow, Menu, session, globalShortcut } = require('electron'); const { autoUpdater } = require('electron-updater'); const { is } = require('electron-util'); const unhandled = require('electron-unhandled'); @@ -94,7 +94,7 @@ const clientId = config.get('discordRPC').clientId; const rpc = new DiscordRPC.Client({ transport: 'ipc' }); const startTimestamp = new Date(); -async function setActivity() { +function setActivity() { if (!rpc || !mainWindow) { return; } @@ -122,7 +122,8 @@ rpc.on('ready', () => { }, 15e3); }); -rpc.login({ clientId }).catch(console.error); +if (config.get('discordRPCEnable')) + rpc.login({ clientId }).catch(console.error); (async () => { await app.whenReady(); -- cgit v1.2.3