diff --git a/api/services/dump-service.ts b/api/services/dump-service.ts index f007f63..ac369a1 100644 --- a/api/services/dump-service.ts +++ b/api/services/dump-service.ts @@ -107,7 +107,9 @@ export async function createUrlDump( broadcastNewDump(dump); notifyUserFollowersNewDump(userId, dumpId, title); } - if (request.comment) notifyMentions(userId, request.comment, "dump", dumpId, title); + if (request.comment) { + notifyMentions(userId, request.comment, "dump", dumpId, title); + } return dump; } @@ -335,7 +337,13 @@ export async function updateDump( if (updatedDump.isPrivate && !dump.isPrivate) broadcastDumpDeleted(dumpId); else if (!updatedDump.isPrivate) broadcastDumpUpdated(updatedDump); if (updatedDump.comment) { - notifyMentions(dump.userId, updatedDump.comment, "dump", dumpId, updatedDump.title); + notifyMentions( + dump.userId, + updatedDump.comment, + "dump", + dumpId, + updatedDump.title, + ); } return updatedDump; } diff --git a/api/services/notification-service.ts b/api/services/notification-service.ts index 85686fe..85793ce 100644 --- a/api/services/notification-service.ts +++ b/api/services/notification-service.ts @@ -207,9 +207,11 @@ export function notifyMentions( ).get(mentionerUserId) as { username: string } | undefined; if (!mentionerRow) return; - const usernames = [...new Set( - [...body.matchAll(MENTION_RE)].map((m) => m[1].toLowerCase()), - )]; + const usernames = [ + ...new Set( + [...body.matchAll(MENTION_RE)].map((m) => m[1].toLowerCase()), + ), + ]; for (const username of usernames) { const mentionedRow = db.prepare( diff --git a/api/services/playlist-service.ts b/api/services/playlist-service.ts index f3414c7..afec7e7 100644 --- a/api/services/playlist-service.ts +++ b/api/services/playlist-service.ts @@ -73,7 +73,9 @@ export function createPlaylist( isPublic: req.isPublic, createdAt, }; - if (req.description) notifyMentions(userId, req.description, "playlist", id, req.title); + if (req.description) { + notifyMentions(userId, req.description, "playlist", id, req.title); + } broadcastPlaylistCreated(playlist); return playlist; } @@ -157,7 +159,14 @@ export function updatePlaylist( const newSlug = makeSlug(newTitle, playlist.id); db.prepare( `UPDATE playlists SET title = ?, slug = ?, description = ?, is_public = ?, updated_at = ? WHERE id = ?;`, - ).run(newTitle, newSlug, newDescription, newIsPublic ? 1 : 0, now.toISOString(), playlist.id); + ).run( + newTitle, + newSlug, + newDescription, + newIsPublic ? 1 : 0, + now.toISOString(), + playlist.id, + ); const updated: Playlist = { ...playlist, @@ -167,7 +176,15 @@ export function updatePlaylist( isPublic: newIsPublic, updatedAt: now, }; - if (newDescription) notifyMentions(requestingUserId, newDescription, "playlist", playlist.id, newTitle); + if (newDescription) { + notifyMentions( + requestingUserId, + newDescription, + "playlist", + playlist.id, + newTitle, + ); + } broadcastPlaylistUpdated(updated); return updated; } diff --git a/src/App.css b/src/App.css index 627d370..11e3619 100644 --- a/src/App.css +++ b/src/App.css @@ -2666,8 +2666,12 @@ body.has-player .fab-new { } @keyframes comment-highlight { - 0% { background: color-mix(in srgb, var(--color-accent) 18%, transparent); } - 100% { background: transparent; } + 0% { + background: color-mix(in srgb, var(--color-accent) 18%, transparent); + } + 100% { + background: transparent; + } } .comment-node--highlight { border-radius: 6px; diff --git a/src/components/CommentThread.tsx b/src/components/CommentThread.tsx index cbf8eb6..2139c99 100644 --- a/src/components/CommentThread.tsx +++ b/src/components/CommentThread.tsx @@ -161,7 +161,9 @@ function CommentNode({ {children.length > 0 && (