1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-27 06:18:07 +09:00

fix(ui): Avoid duplicate IDs for grouped notifications (#3014)

This commit is contained in:
Wladimir Palant 2024-10-26 05:37:40 +02:00 committed by GitHub
parent c153f719fe
commit 49a5f49966
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,8 @@ const groupCapacity = Number.MAX_VALUE // No limit
const includeNotificationTypes: mastodon.v1.NotificationType[] = ['update', 'mention', 'poll', 'status'] const includeNotificationTypes: mastodon.v1.NotificationType[] = ['update', 'mention', 'poll', 'status']
let id = 0
function includeNotificationsForStatusCard({ type, status }: mastodon.v1.Notification) { function includeNotificationsForStatusCard({ type, status }: mastodon.v1.Notification) {
// Exclude update, mention, pool and status notifications without the status entry: // Exclude update, mention, pool and status notifications without the status entry:
// no makes sense to include them // no makes sense to include them
@ -44,7 +46,6 @@ function hasHeader(account: mastodon.v1.Account) {
function groupItems(items: mastodon.v1.Notification[]): NotificationSlot[] { function groupItems(items: mastodon.v1.Notification[]): NotificationSlot[] {
const results: NotificationSlot[] = [] const results: NotificationSlot[] = []
let id = 0
let currentGroupId = '' let currentGroupId = ''
let currentGroup: mastodon.v1.Notification[] = [] let currentGroup: mastodon.v1.Notification[] = []
const processGroup = () => { const processGroup = () => {