Skip to content

Commit

Permalink
fix: reorder notification logic to ensure toast and click event are p…
Browse files Browse the repository at this point in the history
…roperly handled
  • Loading branch information
hichemfantar committed Nov 19, 2024
1 parent 10cfc2c commit 3eea54d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/frontend/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ window.bridge.onUpdateAvailable(() => {
const NOTIFICATION_BODY = "A new version of the app is available.";
const CLICK_MESSAGE = "Notification clicked!";

new window.Notification(NOTIFICATION_TITLE, {
body: NOTIFICATION_BODY,
}).onclick = () => {
// document.getElementById("output").innerText = CLICK_MESSAGE;
};

toast({
title: NOTIFICATION_TITLE,
description: NOTIFICATION_BODY,
// "A new version of the app is available. Please download and install the new version.",
});

new window.Notification(NOTIFICATION_TITLE, {
body: NOTIFICATION_BODY,
}).onclick = () => {
// document.getElementById("output").innerText = CLICK_MESSAGE;
};
});

export function App() {
Expand Down

0 comments on commit 3eea54d

Please sign in to comment.