From 8c162548a87bf8f07b8235a80114e141c270076e Mon Sep 17 00:00:00 2001 From: Alexis Date: Tue, 14 Sep 2021 08:30:14 +0930 Subject: [PATCH] fix: connect to relay on new API key from undefined --- app/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/index.ts b/app/index.ts index 221354514..78c6b1b9a 100644 --- a/app/index.ts +++ b/app/index.ts @@ -137,6 +137,12 @@ am(async () => { sockets.relay?.start(); }); + // We had no key but we now do + // Let's connect to relay! + if (lastKnownApiKey === undefined && newApiKey.startsWith('unraid_')) { + sockets.relay?.start(); + } + // Reconnect subscriptions if we now have a valid key if (newApiKey) { coreLogger.debug('Connecting to mothership\'s subscription endpoint.');