summaryrefslogtreecommitdiff
path: root/packages/backend/src/server
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2025-06-14 18:36:22 +0100
committerdakkar <dakkar@thenautilus.net>2025-06-14 18:38:18 +0100
commitb0275f86fe28e9160e0f0bd62ceecc9be863cf59 (patch)
tree1585c5ada885897e90f1b041e6bc576840ab4ca3 /packages/backend/src/server
parentgroup notifications regardless of when they happened - fix #633 (diff)
downloadsharkey-b0275f86fe28e9160e0f0bd62ceecc9be863cf59.tar.gz
sharkey-b0275f86fe28e9160e0f0bd62ceecc9be863cf59.tar.bz2
sharkey-b0275f86fe28e9160e0f0bd62ceecc9be863cf59.zip
annotate types
Diffstat (limited to 'packages/backend/src/server')
-rw-r--r--packages/backend/src/server/api/endpoints/i/notifications-grouped.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts
index 4b0b9d0884..444734070f 100644
--- a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts
+++ b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts
@@ -106,8 +106,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
// grouping
const groupedNotifications : MiGroupedNotification[] = [];
// keep track of where reaction / renote notifications are, by note id
- const reactionIdxByNoteId = new Map();
- const renoteIdxByNoteId = new Map();
+ const reactionIdxByNoteId = new Map<string, number>();
+ const renoteIdxByNoteId = new Map<string, number>();
// group notifications by type+note; notice that we don't try to
// split groups if they span a long stretch of time, because
@@ -130,7 +130,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
continue;
}
- let prevReaction = groupedNotifications[reactionIdx];
+ let prevReaction = groupedNotifications[reactionIdx] as FilterUnionByProperty<MiGroupedNotification, 'type', 'reaction:grouped'> | FilterUnionByProperty<MiGroupedNotification, 'type', 'reaction'>;
// if the previous reaction is not a group, make it into one
if (prevReaction.type !== 'reaction:grouped') {
prevReaction = groupedNotifications[reactionIdx] = {
@@ -162,7 +162,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
continue;
}
- let prevRenote = groupedNotifications[renoteIdx];
+ let prevRenote = groupedNotifications[renoteIdx] as FilterUnionByProperty<MiGroupedNotification, 'type', 'renote:grouped'> | FilterUnionByProperty<MiGroupedNotification, 'type', 'renote'>;
// if the previous renote is not a group, make it into one
if (prevRenote.type !== 'renote:grouped') {
prevRenote = groupedNotifications[renoteIdx] = {