Fix t.me links to private chats (#1593)

This commit is contained in:
Alexander Zinchuk 2021-12-21 12:17:01 +03:00
parent 23147c8af3
commit 8ca0f72060
2 changed files with 4 additions and 4 deletions

View File

@ -567,7 +567,7 @@ addReducer('openTelegramLink', (global, actions, payload) => {
return; return;
} }
const chatOrChannelPostId = part2 ? Number(part2) : undefined; const chatOrChannelPostId = part2 || undefined;
const messageId = part3 ? Number(part3) : undefined; const messageId = part3 ? Number(part3) : undefined;
const commentId = params.comment ? Number(params.comment) : undefined; const commentId = params.comment ? Number(params.comment) : undefined;
@ -578,13 +578,13 @@ addReducer('openTelegramLink', (global, actions, payload) => {
}); });
} else if (part1 === 'c' && chatOrChannelPostId && messageId) { } else if (part1 === 'c' && chatOrChannelPostId && messageId) {
actions.focusMessage({ actions.focusMessage({
chatId: -chatOrChannelPostId, chatId: `-${chatOrChannelPostId}`,
messageId, messageId,
}); });
} else { } else {
actions.openChatByUsername({ actions.openChatByUsername({
username: part1, username: part1,
messageId: messageId || chatOrChannelPostId, messageId: messageId || Number(chatOrChannelPostId),
commentId, commentId,
}); });
} }

View File

@ -54,7 +54,7 @@ export const processDeepLink = (url: string) => {
} = params; } = params;
focusMessage({ focusMessage({
chatId: -Number(channel), chatId: `-${channel}`,
id: post, id: post,
}); });
break; break;