mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 19:46:33 +00:00
fix: regressions
This commit is contained in:
@@ -64,23 +64,33 @@ pub async fn create(
|
|||||||
.insert_many(user_ids, &mut txn, &redis)
|
.insert_many(user_ids, &mut txn, &redis)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
txn.commit().await?;
|
let notifications = DBNotification::get_many(¬ification_ids, &mut txn)
|
||||||
|
|
||||||
let notifications = DBNotification::get_many(¬ification_ids, &**pool)
|
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(Notification::from)
|
.map(Notification::from)
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
txn.commit().await?;
|
||||||
|
|
||||||
for notification in notifications {
|
for notification in notifications {
|
||||||
broadcast_friends_message(
|
let notification_id = notification.id;
|
||||||
|
let to_user = notification.user_id;
|
||||||
|
if let Err(error) = broadcast_friends_message(
|
||||||
&redis,
|
&redis,
|
||||||
RedisFriendsMessage::Notification {
|
RedisFriendsMessage::Notification {
|
||||||
to_user: notification.user_id,
|
to_user,
|
||||||
notification,
|
notification,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await?;
|
.await
|
||||||
|
{
|
||||||
|
tracing::warn!(
|
||||||
|
?error,
|
||||||
|
?notification_id,
|
||||||
|
?to_user,
|
||||||
|
"failed to broadcast realtime notification"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(HttpResponse::Accepted().finish())
|
Ok(HttpResponse::Accepted().finish())
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ withDefaults(
|
|||||||
right: 1.5rem;
|
right: 1.5rem;
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
width: 520px;
|
width: 520px;
|
||||||
|
max-width: calc(100vw - 3rem);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
@@ -192,6 +193,7 @@ withDefaults(
|
|||||||
@media screen and (max-width: 500px) {
|
@media screen and (max-width: 500px) {
|
||||||
.popup-notification-group {
|
.popup-notification-group {
|
||||||
width: calc(100% - 1.5rem);
|
width: calc(100% - 1.5rem);
|
||||||
|
max-width: none;
|
||||||
right: 0.75rem;
|
right: 0.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user