From 3a165bc6ebb14dcdba44368d12c57e5f030bb9c2 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Tue, 12 Jul 2022 23:30:01 -0300 Subject: [PATCH] Regression: Livechat rooms not opening due to route desync (#26209) --- apps/meteor/client/lib/rooms/roomTypes/livechat.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/meteor/client/lib/rooms/roomTypes/livechat.ts b/apps/meteor/client/lib/rooms/roomTypes/livechat.ts index 7992694cf40..812527b2eda 100644 --- a/apps/meteor/client/lib/rooms/roomTypes/livechat.ts +++ b/apps/meteor/client/lib/rooms/roomTypes/livechat.ts @@ -37,7 +37,15 @@ roomCoordinator.add(LivechatRoomType, { return false; } - instance.tabBar.openUserInfo(); + /* @TODO Due to route information only updating on `Tracker.afterFlush`, + we found out that calling the tabBar.openUserInfo() method at this point will cause a route change + to the previous route instead of the current one, preventing livechat rooms from being opened. + + As a provisory solution, we're delaying the opening of the contextual bar, + which then ensures that the route info is up to date. Although this solution works, + we need to find a more reliable way of ensuring consistent route changes with up-to-date information. + */ + setTimeout(() => instance.tabBar.openUserInfo(), 0); return true; },