diff --git a/src/modules/actions/api/chats.ts b/src/modules/actions/api/chats.ts index a21d8d43a..c032e4520 100644 --- a/src/modules/actions/api/chats.ts +++ b/src/modules/actions/api/chats.ts @@ -567,7 +567,7 @@ addReducer('openTelegramLink', (global, actions, payload) => { return; } - const chatOrChannelPostId = part2 ? Number(part2) : undefined; + const chatOrChannelPostId = part2 || undefined; const messageId = part3 ? Number(part3) : undefined; const commentId = params.comment ? Number(params.comment) : undefined; @@ -578,13 +578,13 @@ addReducer('openTelegramLink', (global, actions, payload) => { }); } else if (part1 === 'c' && chatOrChannelPostId && messageId) { actions.focusMessage({ - chatId: -chatOrChannelPostId, + chatId: `-${chatOrChannelPostId}`, messageId, }); } else { actions.openChatByUsername({ username: part1, - messageId: messageId || chatOrChannelPostId, + messageId: messageId || Number(chatOrChannelPostId), commentId, }); } diff --git a/src/util/deeplink.ts b/src/util/deeplink.ts index 863e8b810..59de80acf 100644 --- a/src/util/deeplink.ts +++ b/src/util/deeplink.ts @@ -54,7 +54,7 @@ export const processDeepLink = (url: string) => { } = params; focusMessage({ - chatId: -Number(channel), + chatId: `-${channel}`, id: post, }); break;