forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '58ace2e45e16a69977267d03874568c11043f04c' into glitch-s…
…oc/merge-upstream
- Loading branch information
Showing
27 changed files
with
300 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
apiGetNotificationPolicy, | ||
apiUpdateNotificationsPolicy, | ||
} from 'mastodon/api/notification_policies'; | ||
import type { NotificationPolicy } from 'mastodon/models/notification_policy'; | ||
import { createDataLoadingThunk } from 'mastodon/store/typed_functions'; | ||
|
||
export const fetchNotificationPolicy = createDataLoadingThunk( | ||
'notificationPolicy/fetch', | ||
() => apiGetNotificationPolicy(), | ||
); | ||
|
||
export const updateNotificationsPolicy = createDataLoadingThunk( | ||
'notificationPolicy/update', | ||
(policy: Partial<NotificationPolicy>) => apiUpdateNotificationsPolicy(policy), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { apiRequest } from 'mastodon/api'; | ||
import type { NotificationPolicyJSON } from 'mastodon/api_types/notification_policies'; | ||
|
||
export const apiGetNotificationPolicy = () => | ||
apiRequest<NotificationPolicyJSON>('GET', '/v1/notifications/policy'); | ||
|
||
export const apiUpdateNotificationsPolicy = ( | ||
policy: Partial<NotificationPolicyJSON>, | ||
) => | ||
apiRequest<NotificationPolicyJSON>('PUT', '/v1/notifications/policy', policy); |
12 changes: 12 additions & 0 deletions
12
app/javascript/mastodon/api_types/notification_policies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// See app/serializers/rest/notification_policy_serializer.rb | ||
|
||
export interface NotificationPolicyJSON { | ||
filter_not_following: boolean; | ||
filter_not_followers: boolean; | ||
filter_new_accounts: boolean; | ||
filter_private_mentions: boolean; | ||
summary: { | ||
pending_requests_count: number; | ||
pending_notifications_count: number; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
app/javascript/mastodon/features/notifications/components/filtered_notifications_banner.jsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.