From 35098276faab29dfd6c91b287e5f5802f09b3859 Mon Sep 17 00:00:00 2001 From: Shigma <1700011071@pku.edu.cn> Date: Wed, 4 May 2022 13:01:53 +0800 Subject: [PATCH] fix(manager): wait for bot visibility change, fix #649 --- plugins/frontend/manager/src/bots.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/frontend/manager/src/bots.ts b/plugins/frontend/manager/src/bots.ts index 1ca1a3df76..f2342aaa0c 100644 --- a/plugins/frontend/manager/src/bots.ts +++ b/plugins/frontend/manager/src/bots.ts @@ -49,11 +49,11 @@ class BotProvider extends DataService> { ctx.on('bot-added', (bot) => { BotProvider.initialize(bot, ctx) - this.refresh() + process.nextTick(() => this.refresh()) }) ctx.on('bot-removed', (bot) => { - this.refresh() + process.nextTick(() => this.refresh()) bot._messageSent.stop() bot._messageReceived.stop() })