Fix multiple bugs in notification requests and notification policies (#32062)
This commit is contained in:
parent
cfb8fc6222
commit
0a6b75b71e
5 changed files with 18 additions and 39 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue