Prevent some odd Update calls if bot is not logged in

This commit is contained in:
Matthias 2024-04-28 09:52:22 +02:00
parent ea55ab606f
commit 9d42d2caba
2 changed files with 2 additions and 2 deletions

View File

@ -206,7 +206,7 @@ export function createBotSubStore(botId: string, botName: string) {
userService.setAutoRefresh(newRefreshValue);
},
setIsBotOnline(isBotOnline: boolean) {
if (!this.isBotOnline && isBotOnline) {
if (!this.isBotOnline && isBotOnline && this.isBotLoggedIn) {
// Bot just came online.
// Refresh everything
this.refreshRequired = true;

View File

@ -239,7 +239,7 @@ export const useBotStore = defineStore('ftbot-wrapper', {
const botStoreUpdates: Promise<BotState>[] = [];
this.allBotStores.forEach((bot) => {
if (bot.isBotOnline && !bot.botStatusAvailable) {
if (bot.isBotLoggedIn && bot.isBotOnline && !bot.botStatusAvailable) {
botStoreUpdates.push(bot.getState());
}
});