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();
// TODO: Name collision!
this.ping = `${result.data.status} ${now.toString()}`;
this.isBotOnline = true;
this.setIsBotOnline(true);
return Promise.resolve();
} catch (error) {
console.log('ping fail');
this.isBotOnline = false;
this.setIsBotOnline(false);
return Promise.reject();
}
},