From ee55446cd6e1d4a813f536d835bf762d46c0ef0e Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Tue, 29 May 2018 23:42:27 -0400 Subject: [PATCH] Temporary fix to DiscordRPC not shutting down properly. Something must have changed on discord's end, as our previous solution is no longer working. The latest changes to the module include a clearActivity() method, however it is not available on npm. Until it is, we are using the implementation directly. --- app/assets/js/discordwrapper.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/js/discordwrapper.js b/app/assets/js/discordwrapper.js index f179951..082c75f 100644 --- a/app/assets/js/discordwrapper.js +++ b/app/assets/js/discordwrapper.js @@ -30,6 +30,8 @@ exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting console.log('Unable to initialize Discord Rich Presence: ' + error.message, error) } }) + + return rpc } exports.updateDetails = function(details){ @@ -42,7 +44,8 @@ exports.updateDetails = function(details){ exports.shutdownRPC = function(){ if(!rpc) return - rpc.setActivity({}) + // Workaround until discord rpc releases clearActivity() + rpc.request('SET_ACTIVITY', {pid: process.pid}) rpc.destroy() rpc = null activity = null