Skip to content

Commit

Permalink
fix: double return
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Oct 19, 2023
1 parent b953dc1 commit 042505b
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions apps/veyfi/contexts/useGauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export type TGaugePosition = {
boost: number;
};

export type TGaugeContext = {
gaugesMap: TDict<TGauge | undefined>,
positionsMap: TDict<TGaugePosition | undefined>,
refresh: () => void,
}
export type TGaugeContext = {
gaugesMap: TDict<TGauge | undefined>;
positionsMap: TDict<TGaugePosition | undefined>;
refresh: () => void;
};
const defaultProps: TGaugeContext = {
gaugesMap: {},
positionsMap: {},
Expand Down Expand Up @@ -150,16 +150,13 @@ export const GaugeContextApp = memo(function GaugeContextApp({children}: {childr
refreshPositions();
}, [refreshPositions, refreshVotingEscrow]);

const contextValue = useDeepCompareMemo((): TGaugeContext => ({
gaugesMap: keyBy(gauges, 'address'),
positionsMap: positionsMap,
refresh
}), [gauges, positionsMap, refresh]);

return (
<GaugeContext.Provider value={contextValue}>
{children}
</GaugeContext.Provider>
const contextValue = useDeepCompareMemo(
(): TGaugeContext => ({
gaugesMap: keyBy(gauges, 'address'),
positionsMap: positionsMap,
refresh
}),
[gauges, positionsMap, refresh]
);

return <GaugeContext.Provider value={contextValue}>{children}</GaugeContext.Provider>;
Expand Down

0 comments on commit 042505b

Please sign in to comment.