Reliably use setIsBotOnline

This commit is contained in:
Matthias 2023-04-02 15:26:05 +02:00
parent 8a7c6cbddc
commit 0644a49ca8

View File

@ -162,11 +162,11 @@ export function createBotSubStore(botId: string, botName: string) {
const now = Date.now(); const now = Date.now();
// TODO: Name collision! // TODO: Name collision!
this.ping = `${result.data.status} ${now.toString()}`; this.ping = `${result.data.status} ${now.toString()}`;
this.isBotOnline = true; this.setIsBotOnline(true);
return Promise.resolve(); return Promise.resolve();
} catch (error) { } catch (error) {
console.log('ping fail'); console.log('ping fail');
this.isBotOnline = false; this.setIsBotOnline(false);
return Promise.reject(); return Promise.reject();
} }
}, },