File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -993,6 +993,14 @@ export function addXp(xp: number): void {
993993 setSnapshot ( snapshot ) ;
994994}
995995
996+ export function updateInboxUnreadSize ( newSize : number ) : void {
997+ const snapshot = getSnapshot ( ) ;
998+ if ( ! snapshot ) return ;
999+
1000+ snapshot . inboxUnreadSize = newSize ;
1001+ setSnapshot ( snapshot ) ;
1002+ }
1003+
9961004export function addBadge ( badge : Badge ) : void {
9971005 const snapshot = getSnapshot ( ) ;
9981006 if ( ! snapshot ) return ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const state: State = {
2929
3030function hide ( ) : void {
3131 setNotificationBubbleVisible ( false ) ;
32+ DB . updateInboxUnreadSize ( 0 ) ;
3233 void modal . hide ( {
3334 afterAnimation : async ( ) => {
3435 $ ( "#alertsPopup .notificationHistory .list" ) . empty ( ) ;
@@ -301,8 +302,9 @@ export function setNotificationBubbleVisible(tf: boolean): void {
301302}
302303
303304function updateInboxSize ( ) : void {
305+ const remainingItems = accountAlerts . length - mailToDelete . length ;
304306 $ ( "#alertsPopup .accountAlerts .title .right" ) . text (
305- `${ accountAlerts . length } /${ maxMail } `
307+ `${ remainingItems } /${ maxMail } `
306308 ) ;
307309}
308310
You can’t perform that action at this time.
0 commit comments