diff options
| author | 8cy <[email protected]> | 2020-06-24 20:27:50 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-06-24 20:27:50 -0700 |
| commit | 8f0d86f7bbdb39bba97d7e26de867fa444a6d489 (patch) | |
| tree | c4935b1df049f37a5def2a49e25dcf748c9da2a7 /index.js | |
| parent | v1.2.0 (diff) | |
| download | monkey-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
Diffstat (limited to 'index.js')
| -rw-r--r-- | index.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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(); |