Skip to content

Commit

Permalink
Cancel break when closing break alert
Browse files Browse the repository at this point in the history
  • Loading branch information
jouni-kantola committed Mar 31, 2024
1 parent 6cb881d commit c271f96
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions resources/scripts/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<template>
<Alert
v-if="information"
:message="information"
@alertClosed="information = ''"
/>
<Alert v-if="information" :message="information" @alertClosed="endBreak" />
<Timer
:minutes="timeRemaining[0]"
:seconds="timeRemaining[1]"
Expand Down Expand Up @@ -134,19 +130,27 @@ async function onEnd() {
await showWindow();
} else {
onBreak.value = false;
timer.value = null;
resetTimeDisplay();
const { index } = whosNextAfter(getActiveMember(team).index, team);
switchActiveMember(index, team);
prepareForNextMember();
endBreak();
await showWindow();
}
}
function endBreak() {
information.value = "";
onBreak.value = false;
timer?.value?.reset();
timer.value = null;
resetTimeDisplay();
const { index } = whosNextAfter(getActiveMember(team).index, team);
switchActiveMember(index, team);
prepareForNextMember();
}
function onIntervalUpdated(seconds: number) {
intervalLength.value = seconds;
timer.value?.change(intervalLength.value);
Expand Down

0 comments on commit c271f96

Please sign in to comment.