From d9792cb754dc73e1d8aea1c1b28a1db3e591bf1e Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 28 Jan 2023 02:16:26 +0100 Subject: [PATCH] Chat: Fix error on loading chat by username (#2402) --- src/global/actions/api/chats.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/global/actions/api/chats.ts b/src/global/actions/api/chats.ts index b0ed46bb0..6903d2b1a 100644 --- a/src/global/actions/api/chats.ts +++ b/src/global/actions/api/chats.ts @@ -2020,13 +2020,12 @@ export async function fetchChatByUsername( global = getGlobal(); global = updateChat(global, chat.id, chat); - setGlobal(global); - if (user) { global = updateUser(global, user.id, user); - setGlobal(global); } + setGlobal(global); + return chat; }