From 0f33ef8732b217313693e61de5ec6153d2e2b0d8 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 a9aec16c4ae..d6f6f52c164 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'; @@ -161,7 +161,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),