Reload function
This commit is contained in:
parent
adf1a18be7
commit
ccd152572c
1 changed files with 11 additions and 0 deletions
|
@ -70,6 +70,7 @@ export default class DiscordRPC {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
ipcMain.on("reloadRPC", () => this.reload())
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -257,4 +258,14 @@ export default class DiscordRPC {
|
||||||
}
|
}
|
||||||
return activity
|
return activity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reloads DiscordRPC
|
||||||
|
*/
|
||||||
|
private reload() {
|
||||||
|
if (this._client) {
|
||||||
|
this._client.destroy()
|
||||||
|
}
|
||||||
|
this.connect()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue