fix(sw): type error in sw (#15844)
This commit is contained in:
parent
86774ad753
commit
c5f1ce60fa
|
@ -271,7 +271,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
|
||||||
case 'newChatMessage':
|
case 'newChatMessage':
|
||||||
if (data.body.toRoom != null) {
|
if (data.body.toRoom != null) {
|
||||||
return [`${data.body.toRoom.name}: ${getUserName(data.body.fromUser)}: ${data.body.text}`, {
|
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'),
|
badge: iconUrl('messages'),
|
||||||
tag: `chat:room:${data.body.toRoomId}`,
|
tag: `chat:room:${data.body.toRoomId}`,
|
||||||
data,
|
data,
|
||||||
|
@ -279,7 +279,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
|
||||||
}];
|
}];
|
||||||
} else {
|
} else {
|
||||||
return [`${getUserName(data.body.fromUser)}: ${data.body.text}`, {
|
return [`${getUserName(data.body.fromUser)}: ${data.body.text}`, {
|
||||||
icon: data.body.fromUser.avatarUrl,
|
icon: data.body.fromUser.avatarUrl ?? undefined,
|
||||||
badge: iconUrl('messages'),
|
badge: iconUrl('messages'),
|
||||||
tag: `chat:user:${data.body.fromUserId}`,
|
tag: `chat:user:${data.body.fromUserId}`,
|
||||||
data,
|
data,
|
||||||
|
|
Loading…
Reference in New Issue