Merge branch 'main' into truman/project-download-modal

This commit is contained in:
Truman Gao
2026-07-03 13:27:03 -06:00
committed by GitHub
+18 -16
View File
@@ -130,23 +130,25 @@ pub async fn ws_init(
)?) )?)
.await; .await;
let unread_server_invites = DBNotification::get_many_user_exposed_on_site( let unread_launcher_invites =
user_id.into(), DBNotification::get_many_user_exposed_on_site(
&**pool, user_id.into(),
&redis, &**pool,
) &redis,
.await? )
.into_iter() .await?
.filter(|notification| { .into_iter()
!notification.read .filter(|notification| {
&& matches!( !notification.read
&notification.body, && matches!(
NotificationBody::ServerInvite { .. } &notification.body,
) NotificationBody::ServerInvite { .. }
}) | NotificationBody::SharedInstanceInvite { .. }
.map(Notification::from); )
})
.map(Notification::from);
for notification in unread_server_invites { for notification in unread_launcher_invites {
let _ = session.text(serde_json::to_string(&notification)?).await; let _ = session.text(serde_json::to_string(&notification)?).await;
} }