@@ -59,7 +59,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
59
59
const userDetail = await cli . request ( 'users/show' , { userId : data . body . userId } , account . token ) ;
60
60
return [ i18n . ts . _notification . youWereFollowed , {
61
61
body : getUserName ( data . body . user ) ,
62
- icon : data . body . user . avatarUrl ,
62
+ icon : data . body . user . avatarUrl ?? undefined ,
63
63
badge : iconUrl ( 'user-plus' ) ,
64
64
data,
65
65
actions : userDetail . isFollowing ? [ ] : [
@@ -74,7 +74,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
74
74
case 'mention' :
75
75
return [ i18n . tsx . _notification . youGotMention ( { name : getUserName ( data . body . user ) } ) , {
76
76
body : data . body . note . text ?? '' ,
77
- icon : data . body . user . avatarUrl ,
77
+ icon : data . body . user . avatarUrl ?? undefined ,
78
78
badge : iconUrl ( 'at' ) ,
79
79
data,
80
80
actions : [
@@ -88,7 +88,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
88
88
case 'reply' :
89
89
return [ i18n . tsx . _notification . youGotReply ( { name : getUserName ( data . body . user ) } ) , {
90
90
body : data . body . note . text ?? '' ,
91
- icon : data . body . user . avatarUrl ,
91
+ icon : data . body . user . avatarUrl ?? undefined ,
92
92
badge : iconUrl ( 'arrow-back-up' ) ,
93
93
data,
94
94
actions : [
@@ -102,7 +102,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
102
102
case 'renote' :
103
103
return [ i18n . tsx . _notification . youRenoted ( { name : getUserName ( data . body . user ) } ) , {
104
104
body : data . body . note . text ?? '' ,
105
- icon : data . body . user . avatarUrl ,
105
+ icon : data . body . user . avatarUrl ?? undefined ,
106
106
badge : iconUrl ( 'repeat' ) ,
107
107
data,
108
108
actions : [
@@ -116,7 +116,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
116
116
case 'quote' :
117
117
return [ i18n . tsx . _notification . youGotQuote ( { name : getUserName ( data . body . user ) } ) , {
118
118
body : data . body . note . text ?? '' ,
119
- icon : data . body . user . avatarUrl ,
119
+ icon : data . body . user . avatarUrl ?? undefined ,
120
120
badge : iconUrl ( 'quote' ) ,
121
121
data,
122
122
actions : [
@@ -136,7 +136,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
136
136
case 'note' :
137
137
return [ i18n . ts . _notification . newNote + ': ' + getUserName ( data . body . user ) , {
138
138
body : data . body . note . text ?? '' ,
139
- icon : data . body . user . avatarUrl ,
139
+ icon : data . body . user . avatarUrl ?? undefined ,
140
140
data,
141
141
} ] ;
142
142
@@ -163,7 +163,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
163
163
const tag = `reaction:${ data . body . note . id } ` ;
164
164
return [ `${ reaction } ${ getUserName ( data . body . user ) } ` , {
165
165
body : data . body . note . text ?? '' ,
166
- icon : data . body . user . avatarUrl ,
166
+ icon : data . body . user . avatarUrl ?? undefined ,
167
167
tag,
168
168
badge,
169
169
data,
@@ -179,7 +179,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
179
179
case 'receiveFollowRequest' :
180
180
return [ i18n . ts . _notification . youReceivedFollowRequest , {
181
181
body : getUserName ( data . body . user ) ,
182
- icon : data . body . user . avatarUrl ,
182
+ icon : data . body . user . avatarUrl ?? undefined ,
183
183
badge : iconUrl ( 'user-plus' ) ,
184
184
data,
185
185
actions : [
@@ -197,7 +197,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
197
197
case 'followRequestAccepted' :
198
198
return [ i18n . ts . _notification . yourFollowRequestAccepted , {
199
199
body : getUserName ( data . body . user ) ,
200
- icon : data . body . user . avatarUrl ,
200
+ icon : data . body . user . avatarUrl ?? undefined ,
201
201
badge : iconUrl ( 'circle-check' ) ,
202
202
data,
203
203
} ] ;
@@ -237,7 +237,7 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
237
237
case 'unreadAntennaNote' :
238
238
return [ i18n . tsx . _notification . unreadAntennaNote ( { name : data . body . antenna . name } ) , {
239
239
body : `${ getUserName ( data . body . note . user ) } : ${ data . body . note . text ?? '' } ` ,
240
- icon : data . body . note . user . avatarUrl ,
240
+ icon : data . body . note . user . avatarUrl ?? undefined ,
241
241
badge : iconUrl ( 'antenna' ) ,
242
242
tag : `antenna:${ data . body . antenna . id } ` ,
243
243
data,
0 commit comments