From 5f09e83ed870336638d3e9d94fcf55ead928e737 Mon Sep 17 00:00:00 2001 From: sct Date: Mon, 14 Dec 2020 05:18:22 +0000 Subject: [PATCH] fix(api): correctly generate clientId on first startup --- server/lib/settings.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/lib/settings.ts b/server/lib/settings.ts index 1fcb48bfd..1f33f3bee 100644 --- a/server/lib/settings.ts +++ b/server/lib/settings.ts @@ -100,7 +100,7 @@ class Settings { constructor(initialSettings?: AllSettings) { this.data = { - clientId: '', + clientId: uuidv4(), main: { apiKey: '', applicationUrl: '', @@ -222,10 +222,10 @@ class Settings { * @param overrideSettings If passed in, will override all existing settings with these * values */ - public load(overrideSettings?: AllSettings): AllSettings { + public load(overrideSettings?: AllSettings): Settings { if (overrideSettings) { this.data = overrideSettings; - return this.data; + return this; } if (!fs.existsSync(SETTINGS_PATH)) { @@ -237,7 +237,7 @@ class Settings { this.data = merge(this.data, JSON.parse(data)); this.save(); } - return this.data; + return this; } public save(): void {