Skip to content

Commit

Permalink
WIP Chain Compare
Browse files Browse the repository at this point in the history
  • Loading branch information
manishiwa committed Feb 2, 2024
1 parent 7b6de1c commit ca4537a
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions components/layout/ChainChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ export default function ChainChart({
// );

useEffect(() => {
const updateChartData = async (key, i) => {
enabledFundamentalsKeys.forEach(async (key, i) => {
if (chartComponents.current[i]) {
// show loading
// chartComponents.current[i].showLoading();
Expand Down Expand Up @@ -1163,21 +1163,9 @@ export default function ChainChart({
});

// redraw the chart
// chartComponents.current[i].redraw();
// chartComponents.current[i].hideLoading();
chartComponents.current[i].redraw();
}
};

const asyncUpdate = async () => {
enabledFundamentalsKeys.forEach(async (key, i) => {
updateChartData(key, i);
chartComponents.current[i]?.redraw(true);
});
};

asyncUpdate();

// }
});
}, [data, enabledFundamentalsKeys, pointHover, showGwei, showUsd, theme]);

const CompChains = useMemo(() => {
Expand Down Expand Up @@ -1358,8 +1346,7 @@ export default function ChainChart({
onClick={() => {
setCompareTo(false);

// wait for the animation to finish
setTimeout(() => updateChainKey([chainKey[0]]), 300);
updateChainKey([chainKey[0]]);
}}
>
<Icon
Expand All @@ -1383,11 +1370,7 @@ export default function ChainChart({
onClick={() => {
setCompareTo(false);

// wait for the animation to finish
setTimeout(
() => updateChainKey([chainKey[0], chain.key]),
300,
);
updateChainKey([chainKey[0], chain.key]);
}}
key={chain.key}
>
Expand Down

0 comments on commit ca4537a

Please sign in to comment.