From 5da2a07146245f411bd84f36aff4ae9c077baca1 Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Sun, 15 Sep 2024 03:07:42 -0700 Subject: [PATCH] Fix flickering --- packages/desktop-client/src/components/accounts/Account.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsx index a2bbee42673..3b47529e76e 100644 --- a/packages/desktop-client/src/components/accounts/Account.tsx +++ b/packages/desktop-client/src/components/accounts/Account.tsx @@ -5,7 +5,7 @@ import React, { createRef, useMemo, type ReactElement, - useEffect, + useLayoutEffect, } from 'react'; import { Trans } from 'react-i18next'; import { useSelector } from 'react-redux'; @@ -160,7 +160,7 @@ function AllTransactions({ const prependTransactions: PreviewTransactionEntity[] = usePreviewTransactions({ accountId }); - useEffect(() => { + useLayoutEffect(() => { splitsExpandedDispatch({ type: 'close-splits', ids: prependTransactions.filter(t => t.is_parent).map(t => t.id),