Revert "CallTimer: Fix timer again apperantly its not resetting now"
This reverts commit 6cd67134fb.
This commit is contained in:
parent
6cd67134fb
commit
bcf87fa382
1 changed files with 7 additions and 4 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs, EquicordDevs } from "@utils/constants";
|
import { Devs, EquicordDevs } from "@utils/constants";
|
||||||
import { useTimer } from "@utils/react";
|
import { useFixedTimer } from "@utils/react";
|
||||||
import { formatDurationMs } from "@utils/text";
|
import { formatDurationMs } from "@utils/text";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { PassiveUpdateState, VoiceState } from "@vencord/discord-types";
|
import { PassiveUpdateState, VoiceState } from "@vencord/discord-types";
|
||||||
|
|
@ -264,14 +264,17 @@ export default definePlugin({
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
renderConnectionTimer({ channelId }: { channelId: string; }) {
|
renderConnectionTimer({ channelId }: { channelId: string | undefined; }) {
|
||||||
return <ErrorBoundary noop>
|
return <ErrorBoundary noop>
|
||||||
<this.ConnectionTimer channelId={channelId} />
|
<this.ConnectionTimer channelId={channelId} />
|
||||||
</ErrorBoundary>;
|
</ErrorBoundary>;
|
||||||
},
|
},
|
||||||
|
|
||||||
ConnectionTimer: ErrorBoundary.wrap(({ channelId }: { channelId: string; }) => {
|
ConnectionTimer: ErrorBoundary.wrap((_: { channelId: string | undefined; }) => {
|
||||||
const time = useTimer({ deps: [channelId] });
|
const joinTime = userJoinTimes.get(UserStore.getCurrentUser().id)?.time;
|
||||||
|
const time = useFixedTimer({ initialTime: joinTime });
|
||||||
|
|
||||||
|
if (joinTime == null) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<p style={{ margin: 0, fontFamily: "var(--font-code)" }}>
|
<p style={{ margin: 0, fontFamily: "var(--font-code)" }}>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue