File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
backend/api/src/junk-drawer Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -173,12 +173,13 @@ const notifyOtherUserInChannelIfInactive = async (
173173 const subscriptions = await getSubscriptionsFromDB ( otherUser . id , pg ) ;
174174 for ( const subscription of subscriptions ) {
175175 try {
176- console . log ( 'Sending notification to:' , subscription . endpoint ) ;
177- await webPush . sendNotification ( subscription , JSON . stringify ( {
176+ const payload = JSON . stringify ( {
178177 title : `${ creator . name } ` ,
179178 body : textContent ,
180179 url : `/messages/${ channelId } ` ,
181- } ) ) ;
180+ } )
181+ console . log ( 'Sending notification to:' , subscription . endpoint , payload ) ;
182+ await webPush . sendNotification ( subscription , payload ) ;
182183 } catch ( err ) {
183184 console . error ( 'Failed to send notification' , err ) ;
184185 // optionally remove invalid subscription from DB
You can’t perform that action at this time.
0 commit comments