Skip to content

Commit

Permalink
Issue 107: Fixed title not switching on timer end (#74)
Browse files Browse the repository at this point in the history
* issue #107: Timer Text Display Issue

* added newline for readability

* added optional chaining to fix undefined

---------

Co-authored-by: Mario Nikhil Pereira <[email protected]>
  • Loading branch information
devd00 and nmpereira authored Jan 6, 2024
1 parent a5e752d commit 6316e16
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helpers/startTimer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ const startCountdown = async ({
io.to(roomName).emit("endTimer", {
isBreakMode: !timerStore[roomName].isBreak,
});

io.to(roomName).emit("updatedTitle", {
title: timerStore[roomName].isBreak
? timerStore[roomName]?.timerTitle?.breakTitle
: timerStore[roomName]?.timerTitle?.workTitle,
});

const currentMessage = messageList({
user: "Anonymous",
room: roomName,
Expand Down

0 comments on commit 6316e16

Please sign in to comment.