try to fix logged error:
Subscription update successful 0c8nsU_N6RQPMalxp5ep_w . Total subscriptions: 2 TypeError: Cannot read properties of null (reading 'pushSubscription')
This commit is contained in:
@ -152,7 +152,7 @@ export const sendPush = async (id, title, message, actions) => {
|
|||||||
where: { id }
|
where: { id }
|
||||||
})
|
})
|
||||||
|
|
||||||
if (Array.isArray(publisher.pushSubscription) && publisher.pushSubscription.length) {
|
if (publisher.pushSubscription && Array.isArray(publisher.pushSubscription) && publisher.pushSubscription.length) {
|
||||||
for (const subscription of publisher.pushSubscription) {
|
for (const subscription of publisher.pushSubscription) {
|
||||||
await webPush
|
await webPush
|
||||||
.sendNotification(
|
.sendNotification(
|
||||||
|
Reference in New Issue
Block a user