Skip to content

Commit

Permalink
updated toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
andorsk committed May 6, 2024
1 parent 9a2f5a1 commit a77bc18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/play/WorkoutNotificationToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function WorkoutNotificationToolbar() {
const showNotification = (title: string, body: string) => {
if ("Notification" in window) {
Notification.requestPermission().then(function (permission) {
alert("notification requested");
if (permission === "granted") {
alert("notification granted");
new Notification(title, { body });
} else {
console.error("Permission denied for Notification");
Expand All @@ -46,7 +48,7 @@ function WorkoutNotificationToolbar() {

useEffect(() => {
console.log("showing notification");
showNotification("Workout", "HI");
showNotification("Web Tabata Timer Workout ", "<div>adsf</div>");
}, [workoutState, workoutState.manager.timer]);

return (
Expand Down

0 comments on commit a77bc18

Please sign in to comment.