A local-first personal finance app
Patch mobile issues - hold for next month, transfer (#5245)
Matiss Janis Aboltins432c2b6165be
diff --git a/packages/desktop-client/src/components/modals/HoldBufferModal.tsx b/packages/desktop-client/src/components/modals/HoldBufferModal.tsxindex 73462f08ad..80beaba805 100644--- a/packages/desktop-client/src/components/modals/HoldBufferModal.tsx+++ b/packages/desktop-client/src/components/modals/HoldBufferModal.tsx@@ -1,4 +1,4 @@-import React, { useState } from 'react';+import React, { useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';import { Button } from '@actual-app/components/button';@@ -27,6 +27,10 @@ export function HoldBufferModal({ onSubmit }: HoldBufferModalProps) {const available = useEnvelopeSheetValue(envelopeBudget.toBudget) ?? 0;const [amount, setAmount] = useState<number>(0);+ useEffect(() => {+ setAmount(available);+ }, [available]);+const _onSubmit = (newAmount: number) => {if (newAmount) {onSubmit?.(newAmount);diff --git a/packages/desktop-client/src/components/modals/TransferModal.tsx b/packages/desktop-client/src/components/modals/TransferModal.tsxindex 72f80febc2..b9e0e6aa71 100644--- a/packages/desktop-client/src/components/modals/TransferModal.tsx+++ b/packages/desktop-client/src/components/modals/TransferModal.tsx@@ -55,7 +55,7 @@ export function TransferModal({return [filteredCategoryGroups, filteredCategories];}, [categoryId, originalCategoryGroups, showToBeBudgeted]);- const [amount, setAmount] = useState<number>(0);+ const [amount, setAmount] = useState<number>(initialAmount);const [toCategoryId, setToCategoryId] = useState<string | null>(null);const dispatch = useDispatch();diff --git a/upcoming-release-notes/5245.md b/upcoming-release-notes/5245.mdnew file mode 100644index 0000000000..049c04c5a8--- /dev/null+++ b/upcoming-release-notes/5245.md@@ -0,0 +1,7 @@+---+category: Bugfix+authors: [MatissJanis]+---++Synchronize `amount` state with external values in HoldBufferModal and TransferModal components.+