mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
refactor: use isDefined util for account ID check in TransactionEditPageBase.ts
This commit is contained in:
@@ -26,7 +26,8 @@ import { Transaction } from '@/models/transaction.ts';
|
|||||||
import { TransactionTemplate } from '@/models/transaction_template.ts';
|
import { TransactionTemplate } from '@/models/transaction_template.ts';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
isArray
|
isArray,
|
||||||
|
isDefined
|
||||||
} from '@/lib/common.ts';
|
} from '@/lib/common.ts';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -432,7 +433,7 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only recalculate if accounts actually changed (skip initial watch call)
|
// Only recalculate if accounts actually changed (skip initial watch call)
|
||||||
if (oldSourceAccountId !== undefined && oldDestinationAccountId !== undefined) {
|
if (isDefined(oldSourceAccountId) && isDefined(oldDestinationAccountId)) {
|
||||||
if (newSourceAccountId === oldSourceAccountId && newDestinationAccountId === oldDestinationAccountId) {
|
if (newSourceAccountId === oldSourceAccountId && newDestinationAccountId === oldDestinationAccountId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user