Skip to content

Commit

Permalink
remove clearTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredvu committed Nov 8, 2024
1 parent 915f39f commit 83fb07f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/hooks/useCurrentMarketId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useRef } from 'react';
import { useEffect, useMemo } from 'react';

import { shallowEqual } from 'react-redux';
import { useMatch, useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -69,8 +69,6 @@ export const useCurrentMarketId = () => {
return marketId ?? lastViewedMarket;
}, [hasMarketIds, marketId]);

const launchedMarketTimeout = useRef<NodeJS.Timeout | null>(null);

const isViewingUnlaunchedMarket = useMemo(() => {
if (!hasMarketIds || !hasLoadedLaunchableMarkets || !testFlags.pml) return false;

Expand All @@ -90,14 +88,6 @@ export const useCurrentMarketId = () => {
marketId,
]);

useEffect(() => {
return () => {
if (launchedMarketTimeout.current) {
clearTimeout(launchedMarketTimeout.current);
}
};
}, []);

const isViewingPredictionMarket = useMemo(() => {
return predictionMarkets.some((market) => market.id === marketId);
}, [predictionMarkets.length, marketId]);
Expand Down

0 comments on commit 83fb07f

Please sign in to comment.