Improve "recovery" behavior if UI is started before the bot is ready

This commit is contained in:
Matthias 2023-04-02 15:26:45 +02:00
parent 0644a49ca8
commit e26431c891
2 changed files with 1 additions and 2 deletions

View File

@ -133,7 +133,6 @@ export function createBotSubStore(botId: string, botName: string) {
if ( if (
state.autoRefresh && state.autoRefresh &&
state.isBotOnline && state.isBotOnline &&
state.botStatusAvailable &&
state.botState?.runmode !== RunModes.WEBSERVER state.botState?.runmode !== RunModes.WEBSERVER
) { ) {
return true; return true;

View File

@ -218,7 +218,7 @@ export const useBotStore = defineStore('wrapper', {
async allRefreshFrequent(forceUpdate = false) { async allRefreshFrequent(forceUpdate = false) {
const updates: Promise<unknown>[] = []; const updates: Promise<unknown>[] = [];
this.allBotStores.forEach(async (e) => { this.allBotStores.forEach(async (e) => {
if (e.refreshNow && (this.globalAutoRefresh || forceUpdate)) { if (e.refreshNow && e.botStatusAvailable && (this.globalAutoRefresh || forceUpdate)) {
updates.push(e.refreshFrequent()); updates.push(e.refreshFrequent());
} }
}); });