diff --git a/src/actions/pomodoro/pomodoro.controller.ts b/src/actions/pomodoro/pomodoro.controller.ts index c7364fd..47c310f 100644 --- a/src/actions/pomodoro/pomodoro.controller.ts +++ b/src/actions/pomodoro/pomodoro.controller.ts @@ -22,7 +22,14 @@ export default class PomodoroController extends EventEmitter { const leftPomodoroVC = oldState.channelId != null && this.pomodoroChannels.includes(oldState.channelId) && newState.channelId !== oldState.channelId; + if (leftPomodoroVC && this.activePomodoros.has(userId)) { + console.log("pomodoro left"); + this.pomodoroService.stopPomodoro(userId); + this.activePomodoros.delete(userId); + } + if (joinedPomodoroVC && !this.activePomodoros.has(userId)) { + console.log("pomodoro join"); const member = newState.member; const vchannel = newState.channel; if (!member || !vchannel) return; @@ -30,12 +37,6 @@ export default class PomodoroController extends EventEmitter { this.activePomodoros.add(userId); this.pomodoroService.startPomodoroLoop(member, vchannel); } - - if (leftPomodoroVC && this.activePomodoros.has(userId)) { - this.pomodoroService.stopPomodoro(userId); - this.activePomodoros.delete(userId); - } }); } - } diff --git a/src/config.ts b/src/config.ts index 7da275c..5a1195b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,6 @@ export default { discord: { - version: 250602.09, + version: 250602.10, // avocadi serverID: process.env.DISCORD_SERVER_ID || "", // texxt channel