0
0
Fork 0

Fix multiple bugs in notification requests and notification policies (#32062)

This commit is contained in:
Claire 2024-09-24 17:03:38 +02:00 committed by GitHub
parent cfb8fc6222
commit 0a6b75b71e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 39 deletions

View file

@ -2,7 +2,7 @@ import { createReducer, isAnyOf } from '@reduxjs/toolkit';
import {
fetchNotificationPolicy,
decreasePendingNotificationsCount,
decreasePendingRequestsCount,
updateNotificationsPolicy,
} from 'mastodon/actions/notification_policies';
import type { NotificationPolicy } from 'mastodon/models/notification_policy';
@ -10,10 +10,9 @@ import type { NotificationPolicy } from 'mastodon/models/notification_policy';
export const notificationPolicyReducer =
createReducer<NotificationPolicy | null>(null, (builder) => {
builder
.addCase(decreasePendingNotificationsCount, (state, action) => {
.addCase(decreasePendingRequestsCount, (state, action) => {
if (state) {
state.summary.pending_notifications_count -= action.payload;
state.summary.pending_requests_count -= 1;
state.summary.pending_requests_count -= action.payload;
}
})
.addMatcher(