diff --git a/src/plugins/callTimer/index.tsx b/src/plugins/callTimer/index.tsx index 9d32ad5ec..cfb939c28 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 { useFixedTimer } from "@utils/react"; +import { useTimer } from "@utils/react"; import { formatDurationMs } from "@utils/text"; import definePlugin, { OptionType } from "@utils/types"; import { PassiveUpdateState, VoiceState } from "@vencord/discord-types"; @@ -264,17 +264,14 @@ export default definePlugin({ ); }, - renderConnectionTimer({ channelId }: { channelId: string | undefined; }) { + renderConnectionTimer({ channelId }: { channelId: string; }) { return ; }, - ConnectionTimer: ErrorBoundary.wrap((_: { channelId: string | undefined; }) => { - const joinTime = userJoinTimes.get(UserStore.getCurrentUser().id)?.time; - const time = useFixedTimer({ initialTime: joinTime }); - - if (joinTime == null) return null; + ConnectionTimer: ErrorBoundary.wrap(({ channelId }: { channelId: string; }) => { + const time = useTimer({ deps: [channelId] }); return (