From 770187586bd52970717b12c812256ab4a38b0381 Mon Sep 17 00:00:00 2001 From: Lennard Fonteijn Date: Sat, 19 Nov 2022 21:50:07 +0100 Subject: [PATCH] Prevent _checkInit debug message when LiveSplit is disabled --- components/index.ts | 6 ++---- components/livesplit/liveSplitManager.ts | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/index.ts b/components/index.ts index ad9bdd45..40b96571 100644 --- a/components/index.ts +++ b/components/index.ts @@ -553,10 +553,8 @@ function startServer(options: { hmr: boolean; pluginDevHost: boolean }): void { initRp() } - if (getFlag("liveSplit") === true) { - // initialize livesplit - liveSplitManager.init() - } + // initialize livesplit + liveSplitManager.init() } program.option( diff --git a/components/livesplit/liveSplitManager.ts b/components/livesplit/liveSplitManager.ts index 7cdca9cd..b5fdc9be 100644 --- a/components/livesplit/liveSplitManager.ts +++ b/components/livesplit/liveSplitManager.ts @@ -230,6 +230,12 @@ export class LiveSplitManager { */ async init() { + if (!getFlag("liveSplit")) { + this._initializationAttempted = true + + return + } + try { logLiveSplitError(await this._liveSplitClient.connect(), "connect") logLiveSplitError( @@ -247,7 +253,6 @@ export class LiveSplitManager { } catch (e) { log(LogLevel.DEBUG, "Failed to initialize LiveSplit: ") log(LogLevel.DEBUG, e) - this._initializationAttempted = true } }