fix: connect to relay on new API key from undefined

This commit is contained in:
Alexis
2021-09-14 08:30:14 +09:30
parent 38dc7d25b3
commit 8c162548a8

View File

@@ -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.');