This commit is contained in:
zadit
2024-10-17 00:15:35 +07:00
parent 4dd12f3835
commit 8f50909e1a
23 changed files with 415 additions and 177 deletions

View File

@@ -20,10 +20,10 @@ self.addEventListener("notificationclick", (event) => {
const { cafeId, transactionId } = event.notification.data; // Get the notification data
// Open the URL with the cafeId and transactionId
event.waitUntil(
clients.openWindow(
`https://srrk5s-3000.csb.app/${cafeId}?modal=new_transaction&transactionId=${transactionId}`
)
);
// Dynamically detect the domain and construct the URL
const domainUrl = self.location.origin;
const url = `${domainUrl}/${cafeId}?modal=new_transaction&transactionId=${transactionId}`;
// Open the constructed URL
event.waitUntil(clients.openWindow(url));
});