From 7800aed0a24d91430b4643400f6c308d05923cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qu=E1=BB=91c=20Kh=C3=A1nh?= Date: Sun, 14 Jul 2024 14:59:26 +0700 Subject: [PATCH] fix(mobile): [Wallet] fix wrong icon when edit wallet account (#119) --- apps/mobile/components/category/category-form.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/mobile/components/category/category-form.tsx b/apps/mobile/components/category/category-form.tsx index d2dd1268..0367d93f 100644 --- a/apps/mobile/components/category/category-form.tsx +++ b/apps/mobile/components/category/category-form.tsx @@ -46,11 +46,14 @@ export const CategoryForm = ({ // biome-ignore lint/correctness/useExhaustiveDependencies: useEffect(() => { + if (defaultValues?.icon) { + return + } categoryForm.setValue( 'icon', type === 'INCOME' ? CATEGORY_INCOME_ICONS[0] : CATEGORY_EXPENSE_ICONS[0], ) - }, [type]) + }, [type, defaultValues?.icon]) const isTypeHidden = hiddenFields.includes('type')