From f6bceb215c88cab928063855a6189270de3e2126 Mon Sep 17 00:00:00 2001 From: moriese Date: Mon, 2 Jun 2025 10:38:08 +0200 Subject: [PATCH] pomodoro fix --- src/actions/pomodoro/pomodoro.controller.ts | 13 +++++++------ src/config.ts | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) 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