fix: make sure to clear out the last file name
This commit is contained in:
parent
9d47c438b4
commit
b89abd7b41
1 changed files with 3 additions and 1 deletions
|
@ -116,6 +116,8 @@ function destroyRPC(): void {
|
||||||
rpc.destroy();
|
rpc.destroy();
|
||||||
// Null the RPC variable.
|
// Null the RPC variable.
|
||||||
rpc = null;
|
rpc = null;
|
||||||
|
// Null the last known file name
|
||||||
|
lastKnownFileName = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function updates the activity (The Client's Rich Presence status).
|
// This function updates the activity (The Client's Rich Presence status).
|
||||||
|
@ -123,7 +125,7 @@ function setActivity(): void {
|
||||||
// Do not continue if RPC isn't initalized.
|
// Do not continue if RPC isn't initalized.
|
||||||
if (!rpc) return;
|
if (!rpc) return;
|
||||||
if (window.activeTextEditor && window.activeTextEditor.document.fileName === lastKnownFileName) return;
|
if (window.activeTextEditor && window.activeTextEditor.document.fileName === lastKnownFileName) return;
|
||||||
lastKnownFileName = window.activeTextEditor ? window.activeTextEditor.document.fileName : '';
|
lastKnownFileName = window.activeTextEditor ? window.activeTextEditor.document.fileName : null;
|
||||||
|
|
||||||
// Create a JSON Object with the user's activity information.
|
// Create a JSON Object with the user's activity information.
|
||||||
const activity = {
|
const activity = {
|
||||||
|
|
Loading…
Reference in a new issue