Skip to content

Commit

Permalink
Made RPC Switch act like killswitch
Browse files Browse the repository at this point in the history
Even if AutoRPC is on, disabled RPC in tray will override it
  • Loading branch information
justkowal committed Nov 3, 2021
1 parent 4f3a879 commit 04d53f4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ app.whenReady().then(() => {

function updateRPC(){
infogetter("127.0.0.1","8080",(info) => {
if(settings.properties.autoOffRPC && !contextMenu.items[0].checked){
if(settings.properties.autoOffRPC && contextMenu.items[0].checked){
try{
console.log('Connecting RPC')
client = require('discord-rich-presence')('900398628529664030')
Expand Down Expand Up @@ -151,9 +151,8 @@ app.whenReady().then(() => {
},(error) => {
console.log(error)
appIcon.setImage(reddot)
if(settings.properties.autoOffRPC){
if(settings.properties.autoOffRPC && contextMenu.items[0].checked){
console.log('Disconnecting RPC')
contextMenu.items[0].checked = false
appIcon.setContextMenu(contextMenu)
client.disconnect()
client = null
Expand Down

0 comments on commit 04d53f4

Please sign in to comment.