Skip to content

Commit

Permalink
Toggle break alert when break start or end
Browse files Browse the repository at this point in the history
  • Loading branch information
jouni-kantola committed Mar 31, 2024
1 parent c271f96 commit d6915fc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions resources/scripts/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<Alert v-if="information" :message="information" @alertClosed="endBreak" />
<Alert
v-if="onBreak"
:message="'🍵 Break time. Grab a tea!'"
@alertClosed="endBreak"
/>
<Timer
:minutes="timeRemaining[0]"
:seconds="timeRemaining[1]"
Expand Down Expand Up @@ -74,7 +78,6 @@ const props = defineProps({
const takeBreaks = ref(true);
const startButtonText = ref("Start");
const team = reactive(props.team);
const information = ref("");
const intervalLength = ref(props.intervalLengthInSeconds);
const timer = ref<ReturnType<typeof startTimer> | null>(null);
const onBreak = ref(false);
Expand Down Expand Up @@ -126,7 +129,6 @@ async function onEnd() {
onBreak.value = true;
resetTimeDisplay();
timer.value = startTimer(intervalLength.value, onBreakTick, onEnd);
information.value = "🍵 Break time. Grab a tea!";
await showWindow();
} else {
Expand All @@ -137,7 +139,6 @@ async function onEnd() {
}
function endBreak() {
information.value = "";
onBreak.value = false;
timer?.value?.reset();
Expand All @@ -164,7 +165,6 @@ async function start() {
if (isPaused || timer.value?.isRunning) return false;
startButtonText.value = "Pause";
information.value = "";
timer.value = startTimer(intervalLength.value, onTick, onEnd);
Expand Down

0 comments on commit d6915fc

Please sign in to comment.