From b89abd7b413de2691d47401a31bf909020c4fd45 Mon Sep 17 00:00:00 2001 From: iCrawl Date: Fri, 24 Nov 2017 04:49:32 +0100 Subject: [PATCH] fix: make sure to clear out the last file name --- src/extension.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 6404f4f..68b0b71 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -116,6 +116,8 @@ function destroyRPC(): void { rpc.destroy(); // Null the RPC variable. rpc = null; + // Null the last known file name + lastKnownFileName = null; } // 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. if (!rpc) 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. const activity = {