From 46bdaea297a15cdc41c89885bf46e7563cd57f8c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 21 Dec 2021 12:17:12 +0300 Subject: [PATCH] Message List: Fix infinite spinner when missing access to chat (#1599) --- src/modules/actions/api/chats.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/actions/api/chats.ts b/src/modules/actions/api/chats.ts index c032e4520..cb789df7e 100644 --- a/src/modules/actions/api/chats.ts +++ b/src/modules/actions/api/chats.ts @@ -577,8 +577,15 @@ addReducer('openTelegramLink', (global, actions, payload) => { inviteHash: params.voicechat || params.livestream, }); } else if (part1 === 'c' && chatOrChannelPostId && messageId) { + const chatId = `-${chatOrChannelPostId}`; + const chat = selectChat(global, chatId); + if (!chat) { + actions.showNotification({ message: 'Chat does not exist' }); + return; + } + actions.focusMessage({ - chatId: `-${chatOrChannelPostId}`, + chatId, messageId, }); } else {