fix(sw): type error in sw (#15844)

This commit is contained in:
anatawa12 2025-04-16 07:51:41 +09:00 committed by GitHub
parent 86774ad753
commit c5f1ce60fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -271,7 +271,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
case 'newChatMessage':
if (data.body.toRoom != null) {
return [`${data.body.toRoom.name}: ${getUserName(data.body.fromUser)}: ${data.body.text}`, {
icon: data.body.fromUser.avatarUrl,
icon: data.body.fromUser.avatarUrl ?? undefined,
badge: iconUrl('messages'),
tag: `chat:room:${data.body.toRoomId}`,
data,
@ -279,7 +279,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
}];
} else {
return [`${getUserName(data.body.fromUser)}: ${data.body.text}`, {
icon: data.body.fromUser.avatarUrl,
icon: data.body.fromUser.avatarUrl ?? undefined,
badge: iconUrl('messages'),
tag: `chat:user:${data.body.fromUserId}`,
data,