-
Notifications
You must be signed in to change notification settings - Fork 75
feat(notifications): sync filter tabs and push toggles across all types #3363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6a29843
da42a52
c144c4a
047e678
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,10 @@ import { | |
| CHANGE_REBLOG_NOTIFICATION, | ||
| CHANGE_TRANSFERS_NOTIFICATION, | ||
| CHANGE_SCHEDULED_PUBLISHED_NOTIFICATION, | ||
| CHANGE_DELEGATIONS_NOTIFICATION, | ||
| CHANGE_PAYOUTS_NOTIFICATION, | ||
| CHANGE_ACCOUNT_UPDATE_NOTIFICATION, | ||
| CHANGE_WEEKLY_EARNINGS_NOTIFICATION, | ||
| CHANGE_VOTE_NOTIFICATION, | ||
| CHANGE_ALL_NOTIFICATION_SETTINGS, | ||
| IS_CONNECTED, | ||
|
|
@@ -76,6 +80,10 @@ interface State { | |
| transfersNotification: boolean; | ||
| voteNotification: boolean; | ||
| scheduledPublishedNotification: boolean; | ||
| delegationsNotification: boolean; | ||
| payoutsNotification: boolean; | ||
| accountUpdateNotification: boolean; | ||
| weeklyEarningsNotification: boolean; | ||
|
Comment on lines
+83
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Include the new fields in the bulk notification-settings reducer.
Suggested fix notificationDetails: {
...state.notificationDetails,
+ delegationsNotification:
+ action.payload.delegationsNotification ??
+ state.notificationDetails.delegationsNotification,
+ payoutsNotification:
+ action.payload.payoutsNotification ??
+ state.notificationDetails.payoutsNotification,
+ accountUpdateNotification:
+ action.payload.accountUpdateNotification ??
+ state.notificationDetails.accountUpdateNotification,
+ weeklyEarningsNotification:
+ action.payload.weeklyEarningsNotification ??
+ state.notificationDetails.weeklyEarningsNotification,
mentionNotification: action.payload.mentionNotification,🤖 Prompt for AI Agents |
||
| }; | ||
| postUpvotePercent: number; | ||
| commentUpvotePercent: number; | ||
|
|
@@ -122,6 +130,10 @@ const initialState: State = { | |
| transfersNotification: true, | ||
| voteNotification: true, | ||
| scheduledPublishedNotification: true, | ||
| delegationsNotification: true, | ||
| payoutsNotification: true, | ||
| accountUpdateNotification: true, | ||
| weeklyEarningsNotification: true, | ||
| }, | ||
| postUpvotePercent: 1, | ||
| commentUpvotePercent: 1, | ||
|
|
@@ -238,6 +250,34 @@ const applicationReducer = (state = initialState, action): State => { | |
| scheduledPublishedNotification: action.payload, | ||
| }, | ||
| }); | ||
| case CHANGE_DELEGATIONS_NOTIFICATION: | ||
| return Object.assign({}, state, { | ||
| notificationDetails: { | ||
| ...state.notificationDetails, | ||
| delegationsNotification: action.payload, | ||
| }, | ||
| }); | ||
| case CHANGE_PAYOUTS_NOTIFICATION: | ||
| return Object.assign({}, state, { | ||
| notificationDetails: { | ||
| ...state.notificationDetails, | ||
| payoutsNotification: action.payload, | ||
| }, | ||
| }); | ||
| case CHANGE_ACCOUNT_UPDATE_NOTIFICATION: | ||
| return Object.assign({}, state, { | ||
| notificationDetails: { | ||
| ...state.notificationDetails, | ||
| accountUpdateNotification: action.payload, | ||
| }, | ||
| }); | ||
| case CHANGE_WEEKLY_EARNINGS_NOTIFICATION: | ||
| return Object.assign({}, state, { | ||
| notificationDetails: { | ||
| ...state.notificationDetails, | ||
| weeklyEarningsNotification: action.payload, | ||
| }, | ||
| }); | ||
| case CHANGE_VOTE_NOTIFICATION: | ||
| return Object.assign({}, state, { | ||
| notificationDetails: { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lookup moves every filter label to
notification.filters.*, but only the English locale defines that namespace. With another supported locale selected, these calls have nodefaultMessage, so the filter bar can display uppercased message IDs such asNOTIFICATION.FILTERS.REPLIESinstead of readable labels.