ok mantab

This commit is contained in:
frontend perkafean
2024-09-28 08:42:17 +00:00
parent 55eb5c189a
commit 4f6b9223ec
4 changed files with 11 additions and 3 deletions

View File

@@ -235,6 +235,13 @@ function App() {
socket.on("transaction_created", async (data) => {
console.log("transaction notification");
setModal("new_transaction", data);
navigator.serviceWorker.ready.then((registration) => {
registration.showNotification("New Transaction", {
body: `A new transaction was created: ${data.transactionDetails}`, // Customize as needed
icon: "icon.png", // Optional icon
});
});
});
socket.on("checkUserTokenRes", async (data) => {