From c3c42ff8d367045650eb1766314cee051945b3e3 Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Sat, 24 Sep 2022 23:02:45 +0100 Subject: [PATCH] Prevent attempting to update SplatNet 3 data for presence if not configured --- src/discord/titles/nintendo/splatoon3.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/discord/titles/nintendo/splatoon3.ts b/src/discord/titles/nintendo/splatoon3.ts index 91f339f..2bd9166 100644 --- a/src/discord/titles/nintendo/splatoon3.ts +++ b/src/discord/titles/nintendo/splatoon3.ts @@ -62,10 +62,10 @@ export default class SplatNet3Monitor extends EmbeddedLoop { return this.config?.friend_nsaid ?? this.discord_presence.znc_discord_presence.presence_user; } - async init(): Promise { + async init(): Promise { if (!this.config) { debug('Not enabling SplatNet 3 monitor - not configured'); - return this.disable(); + return LoopResult.STOP; } debug('Started monitor'); @@ -83,7 +83,7 @@ export default class SplatNet3Monitor extends EmbeddedLoop { } catch (err) { const result = await this.discord_presence.handleError(err as Error); if (result === ErrorResult.RETRY) return this.init(); - if (result === ErrorResult.STOP) return this.disable(); + if (result === ErrorResult.STOP) return LoopResult.STOP; } const history = await this.splatnet!.getHistoryRecords(); @@ -103,7 +103,7 @@ export default class SplatNet3Monitor extends EmbeddedLoop { async update() { if (!this.config) { debug('Not updating SplatNet 3 monitor - not configured'); - return this.disable(); + return LoopResult.STOP; } const friends = this.cached_friends ?? await this.splatnet?.getFriendsRefetch();