From 00f4a779c90715dbf2b5c0438387c40fcdec31fa Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Wed, 9 Dec 2020 23:10:57 +1030 Subject: [PATCH] fix(api-manager): skip "same key" check on first load --- app/core/api-manager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/core/api-manager.ts b/app/core/api-manager.ts index c084f9c2d..f8933c2ed 100644 --- a/app/core/api-manager.ts +++ b/app/core/api-manager.ts @@ -65,14 +65,14 @@ export class ApiManager extends EventEmitter { }; } - private async checkKey(filePath) { + private async checkKey(filePath: string, force = false) { const lock = await this.getLock(); try { const file = loadState<{ remote: { apikey: string } }>(filePath); const apiKey = dotProp.get(file, 'remote.apikey') as string; // Same key as current - if (apiKey === this.getKey('my_servers')?.key) { + if (!force && (apiKey === this.getKey('my_servers')?.key)) { coreLogger.debug(`%s was updated but the API key didn't change`, filePath); return; } @@ -131,7 +131,7 @@ export class ApiManager extends EventEmitter { } // Load inital keys in - this.checkKey(configPath); + this.checkKey(configPath, true); } /**