Skip to content

Commit

Permalink
Temporary fix to DiscordRPC not shutting down properly.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dscalzi committed May 30, 2018
1 parent daa6faa commit ee55446
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/assets/js/discordwrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ exports.initRPC = function(genSettings, servSettings, initialDetails = 'Waiting
console.log('Unable to initialize Discord Rich Presence: ' + error.message, error)
}
})

return rpc

This comment has been minimized.

Copy link
@dscalzi

dscalzi May 30, 2018

Author Owner

This was for debugging, will be removed.

}

exports.updateDetails = function(details){
Expand All @@ -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
Expand Down

0 comments on commit ee55446

Please sign in to comment.