sw: なんかもうめっちゃ変えた (#10570)
* sw: なんかいろいろ * remove debug code * never renotify * update changelog.md
This commit is contained in:
BIN
packages/backend/assets/tabler-badges/medal.png
Normal file
BIN
packages/backend/assets/tabler-badges/medal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@@ -66,6 +66,7 @@ export class NotificationService implements OnApplicationShutdown {
|
||||
@bindThis
|
||||
private postReadAllNotifications(userId: User['id']) {
|
||||
this.globalEventService.publishMainStream(userId, 'readAllNotifications');
|
||||
this.pushNotificationService.pushNotification(userId, 'readAllNotifications', undefined);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
@@ -15,6 +15,7 @@ type PushNotificationsTypes = {
|
||||
antenna: { id: string, name: string };
|
||||
note: Packed<'Note'>;
|
||||
};
|
||||
'readAllNotifications': undefined;
|
||||
};
|
||||
|
||||
// Reduce length because push message servers have character limits
|
||||
@@ -68,6 +69,10 @@ export class PushNotificationService {
|
||||
});
|
||||
|
||||
for (const subscription of subscriptions) {
|
||||
if ([
|
||||
'readAllNotifications',
|
||||
].includes(type) && !subscription.sendReadMessage) continue;
|
||||
|
||||
const pushSubscription = {
|
||||
endpoint: subscription.endpoint,
|
||||
keys: {
|
||||
|
Reference in New Issue
Block a user