From 96d4c9e2bd3d973b8f6858d341d7b73637f4fc47 Mon Sep 17 00:00:00 2001 From: creations Date: Fri, 8 May 2026 11:59:22 -0400 Subject: [PATCH] fix calltimer resetting (#1060) --- src/plugins/callTimer/index.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/callTimer/index.tsx b/src/plugins/callTimer/index.tsx index db4c0e6af..9d32ad5ec 100644 --- a/src/plugins/callTimer/index.tsx +++ b/src/plugins/callTimer/index.tsx @@ -7,7 +7,7 @@ import { definePluginSettings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs, EquicordDevs } from "@utils/constants"; -import { useTimer } from "@utils/react"; +import { useFixedTimer } from "@utils/react"; import { formatDurationMs } from "@utils/text"; import definePlugin, { OptionType } from "@utils/types"; import { PassiveUpdateState, VoiceState } from "@vencord/discord-types"; @@ -264,16 +264,17 @@ export default definePlugin({ ); }, - renderConnectionTimer(channelId: string) { + renderConnectionTimer({ channelId }: { channelId: string | undefined; }) { return ; }, - ConnectionTimer: ErrorBoundary.wrap(({ channelId }: { channelId: string; }) => { - const time = useTimer({ - deps: [channelId] - }); + ConnectionTimer: ErrorBoundary.wrap((_: { channelId: string | undefined; }) => { + const joinTime = userJoinTimes.get(UserStore.getCurrentUser().id)?.time; + const time = useFixedTimer({ initialTime: joinTime }); + + if (joinTime == null) return null; return (