Changeset e951b7c in Klonkt for src/middleware/render.js


Ignore:
Timestamp:
06/25/2026 05:22:51 AM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
4c9c60b
Parents:
d7526bd
Message:

feat(fediverse): real bell badge for unseen notifications

Track a per-site 'seen' timestamp (app_settings); the top-bar bell shows a badge
with the count of fediverse notifications newer than last-seen, and opening
/meldingen marks them seen (clears the badge). Replaces the dead user_notifications
counter.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/middleware/render.js

    rd7526bd re951b7c  
    1919import { getSetting } from '../services/SettingsService.js';
    2020import { isPremium as isPremiumInstance, premiumEnabled, premiumUnlocked } from '../services/PatreonService.js';
    21 import { unreadCount as notifUnreadCount } from '../services/NotificationService.js';
     21import ActivityPubService from '../services/ActivityPubService.js';
    2222import { audioEnabled as audioFeatureEnabled } from '../config/features.js';
    2323import { PLATFORMS as PLATFORMS_CATALOG } from '../services/PlatformIcons.js';
     
    118118    langs: LANGS.map((c) => ({ code: c, name: LANG_NAMES[c], active: c === _lang })),
    119119    timezone: getSetting('timezone') || '',
    120     notifUnread: _u ? notifUnreadCount(_u.id) : 0,
     120    notifUnread: (canManageFedi && _site) ? ActivityPubService.countUnseenNotifications(_site.slug) : 0,
    121121    userOwnsSite,
    122122    canSeeBeheer,
Note: See TracChangeset for help on using the changeset viewer.