Note Edited notification type

This commit is contained in:
Marie 2024-02-20 15:10:41 +00:00 committed by Amelia Yukii
parent 15665d1533
commit 4a13508da0
17 changed files with 94 additions and 63 deletions

View file

@ -232,6 +232,14 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
data,
}];
case 'edited':
return [t('_notification.edited', { name: getUserName(data.body.user) }), {
body: data.body.note.text ?? '',
icon: data.body.user.avatarUrl,
badge: iconUrl('messages'),
data,
}];
default:
return null;
}

View file

@ -133,6 +133,9 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv
case 'showFollowRequests':
client = await swos.openClient('push', '/my/follow-requests', loginId);
break;
case 'edited':
if ('note' in data.body) client = await swos.openPost({ reply: data.body.note }, loginId);
break;
default:
switch (data.body.type) {
case 'receiveFollowRequest':