Avoid creating duplicate invite notifications

This commit is contained in:
Max Brunsfeld 2023-10-13 16:57:28 -07:00
parent 5a0afcc835
commit cb7b011d6b
6 changed files with 109 additions and 44 deletions

View file

@ -209,7 +209,12 @@ impl NotificationPanel {
channel_id,
} => {
actor = user_store.get_cached_user(inviter_id)?;
let channel = channel_store.channel_for_id(channel_id)?;
let channel = channel_store.channel_for_id(channel_id).or_else(|| {
channel_store
.channel_invitations()
.iter()
.find(|c| c.id == channel_id)
})?;
icon = "icons/hash.svg";
text = format!(