Fix ghost notifications on closed DMs.

Fix link warning not closing on open.
This commit is contained in:
Paul 2021-08-30 13:26:19 +01:00
parent 44fdee1214
commit 0ca99ddceb
2 changed files with 7 additions and 3 deletions

View file

@ -244,10 +244,11 @@ export const ServerListSidebar = observer(({ unreads, lastOpened }: Props) => {
homeUnread = "unread"; homeUnread = "unread";
alertCount += x.alertCount ?? 0; alertCount += x.alertCount ?? 0;
} }
if ( if (
x.channel?.channel_type === "DirectMessage" && x.channel?.channel_type === "DirectMessage" &&
x.unread && x.channel.active &&
x.unread.length > 0 x.unread
) )
alertCount++; alertCount++;
} }

View file

@ -15,7 +15,10 @@ export function ExternalLinkModal({ onClose, link }: Props) {
title={<Text id={"app.special.modals.external_links.title"} />} title={<Text id={"app.special.modals.external_links.title"} />}
actions={[ actions={[
{ {
onClick: ()=>{window.open(link, "_blank");}, onClick: () => {
window.open(link, "_blank");
onClose();
},
confirmation: true, confirmation: true,
contrast: true, contrast: true,
accent: true, accent: true,