Skip to content

Commit

Permalink
Merge branch 'frontend-fix-chart-edgecase'
Browse files Browse the repository at this point in the history
  • Loading branch information
thisconnect committed Dec 9, 2024
2 parents 0c3f44f + 85201c3 commit e1d6d34
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontends/web/src/routes/account/summary/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { PercentageDiff } from './percentage-diff';
import { Filters } from './filters';
import { getDarkmode } from '@/components/darkmode/darkmode';
import { DefaultCurrencyRotator } from '@/components/rates/rates';
import { RatesContext } from '@/contexts/RatesContext';
import { AppContext, TChartDisplay } from '@/contexts/AppContext';
import styles from './chart.module.css';

Expand Down Expand Up @@ -137,6 +138,7 @@ export const Chart = ({

const { t, i18n } = useTranslation();
const { chartDisplay, setChartDisplay } = useContext(AppContext);
const { defaultCurrency } = useContext(RatesContext);
const [searchParams] = useSearchParams();

const ref = useRef<HTMLDivElement>(null);
Expand All @@ -163,6 +165,15 @@ export const Chart = ({
toolTipTime: 0,
});

useEffect(() => {
setTooltipData({
toolTipVisible: false,
toolTipTop: 0,
toolTipLeft: 0,
toolTipTime: 0,
});
}, [defaultCurrency]);

const [showAnimationOverlay, setAnimationOverlay] = useState(true);

const prevChartDataDaily = usePrevious(data.chartDataDaily);
Expand Down

0 comments on commit e1d6d34

Please sign in to comment.