summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author8cy <[email protected]>2020-06-24 20:27:50 -0700
committer8cy <[email protected]>2020-06-24 20:27:50 -0700
commit8f0d86f7bbdb39bba97d7e26de867fa444a6d489 (patch)
treec4935b1df049f37a5def2a49e25dcf748c9da2a7
parentv1.2.0 (diff)
downloadmonkey-type-desktop-8f0d86f7bbdb39bba97d7e26de867fa444a6d489.tar.xz
monkey-type-desktop-8f0d86f7bbdb39bba97d7e26de867fa444a6d489.zip
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
-rw-r--r--config.js1
-rw-r--r--index.js7
2 files changed, 5 insertions, 3 deletions
diff --git a/config.js b/config.js
index 12392c3..bf42c2a 100644
--- a/config.js
+++ b/config.js
@@ -6,6 +6,7 @@ module.exports = new Store({
debugEnable: false,
menuEnable: true,
configCookieOverwrite: '',
+ discordRPCEnable: true,
discordRPC: {
clientId: '722389325483999243',
RPC: {
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();