diff --git a/apps/frontend/src/views/DonateView.vue b/apps/frontend/src/views/DonateView.vue
index 27036ed..145f400 100644
--- a/apps/frontend/src/views/DonateView.vue
+++ b/apps/frontend/src/views/DonateView.vue
@@ -22,7 +22,7 @@
Рассказать друзьям
Поделитесь ссылкой на НаСвязи:
-
+
-
+
@@ -40,7 +40,7 @@
rel="noopener noreferrer"
class="p-button-rounded p-button-text p-button-lg inline-flex items-center justify-center"
>
-
+
diff --git a/services/message-delivery-method-web-push/src/server.ts b/services/message-delivery-method-web-push/src/server.ts
index 5603caf..2f3b40c 100644
--- a/services/message-delivery-method-web-push/src/server.ts
+++ b/services/message-delivery-method-web-push/src/server.ts
@@ -62,40 +62,46 @@ const start = async () => {
if (rows.length === 0) {
console.log("NO SUBSCRIPTIONS");
+ } else {
+ console.log(`sending to ${rows.length} devices`);
}
for (const row of rows) {
- const subscription = row.doc.subscription;
- const topic = `chat-${msgDoc.qr_code_uri}-${msgDoc.chat}`;
- const tag = `${topic}-${(new Date(msgDoc.created_at).getTime() - new Date(qrDoc.created_at).getTime()).toString(36)}`;
+ try {
+ const subscription = row.doc.subscription;
+ const topic = `chat-${msgDoc.qr_code_uri}-${msgDoc.chat}`;
+ const tag = `${topic}-${(new Date(msgDoc.created_at).getTime() - new Date(qrDoc.created_at).getTime()).toString(36)}`;
- const options: NotificationOptions = {
- icon: "/images/qr-code-logo-200x200.jpg",
- body: msgDoc.body,
- tag,
- requireInteraction: true,
- data: {
- url: `/manage/${msgDoc.qr_code_uri}/chat/${msgDoc.chat}`,
- payload: { tag },
- },
- } as const;
-
- await webpush.sendNotification(
- subscription,
- JSON.stringify({
- type: "notification",
- notification: {
- title: qrDoc.name,
- options,
+ const options: NotificationOptions = {
+ icon: "/images/qr-code-logo-200x200.jpg",
+ body: msgDoc.body,
+ tag,
+ requireInteraction: true,
+ data: {
+ url: `/manage/${msgDoc.qr_code_uri}/chat/${msgDoc.chat}`,
+ payload: { tag },
},
- }),
- {
- urgency: "high",
- topic,
- },
- );
+ } as const;
- console.log("sent");
+ await webpush.sendNotification(
+ subscription,
+ JSON.stringify({
+ type: "notification",
+ notification: {
+ title: qrDoc.name,
+ options,
+ },
+ }),
+ {
+ urgency: "high",
+ topic,
+ },
+ );
+ } catch (error) {
+ console.error(
+ `Error sending notification to ${row.id} - ${JSON.stringify(error)}`,
+ );
+ }
}
} else if (msgDoc.from === "owner") {
console.log("FROM OWNER");