code refactor

This commit is contained in:
MaysWind
2025-02-09 15:58:55 +08:00
parent 596787b998
commit f2c043a299
6 changed files with 23 additions and 23 deletions
+2 -2
View File
@@ -267,7 +267,7 @@ function init(): void {
}
}
function reload(done: (() => void) | null): void {
function reload(done?: () => void): void {
const force = !!done;
overviewStore.loadTransactionOverview({
@@ -289,7 +289,7 @@ function reload(done: (() => void) | null): void {
function onPageAfterIn(): void {
if (!loading.value) {
reload(null);
reload();
}
}
+2 -2
View File
@@ -275,7 +275,7 @@ function init(): void {
});
}
function reload(done: (() => void) | null): void {
function reload(done?: () => void): void {
if (sortable.value) {
done?.();
return;
@@ -418,7 +418,7 @@ function onSort(event: { el: { id: string }; from: number; to: number }): void {
function onPageAfterIn(): void {
if (accountsStore.accountListStateInvalid && !loading.value) {
reload(null);
reload();
}
routeBackOnError(props.f7router, loadingError);
+2 -2
View File
@@ -229,7 +229,7 @@ function init(): void {
});
}
function reload(done: (() => void) | null): void {
function reload(done?: () => void): void {
if (sortable.value) {
done?.();
return;
@@ -373,7 +373,7 @@ function onSort(event: { el: { id: string }; from: number; to: number }): void {
function onPageAfterIn(): void {
if (transactionCategoriesStore.transactionCategoryListStateInvalid && !loading.value) {
reload(null);
reload();
}
routeBackOnError(props.f7router, loadingError);
+2 -2
View File
@@ -224,7 +224,7 @@ function init(): void {
});
}
function reload(done: (() => void) | null): void {
function reload(done?: () => void): void {
if (sortable.value || hasEditingTag.value) {
done?.();
return;
@@ -402,7 +402,7 @@ function onSort(event: { el: { id: string }, from: number, to: number }): void {
function onPageAfterIn(): void {
if (transactionTagsStore.transactionTagListStateInvalid && !loading.value) {
reload(null);
reload();
}
routeBackOnError(props.f7router, loadingError);
+2 -2
View File
@@ -165,7 +165,7 @@ function init(): void {
});
}
function reload(done: (() => void) | null): void {
function reload(done?: () => void): void {
if (sortable.value) {
done?.();
return;
@@ -310,7 +310,7 @@ function onSort(event: { el: { id: string }; from: number; to: number }): void {
function onPageAfterIn(): void {
if ((!isDefined(transactionTemplatesStore.transactionTemplateListStatesInvalid[templateType.value]) || transactionTemplatesStore.transactionTemplateListStatesInvalid[templateType.value]) && !loading.value) {
reload(null);
reload();
}
routeBackOnError(props.f7router, loadingError);
+13 -13
View File
@@ -700,10 +700,10 @@ function init(): void {
tagFilterType: initQuery['tagFilterType'] && parseInt(initQuery['tagFilterType']) >= 0 ? parseInt(initQuery['tagFilterType']) : undefined
});
reload(null);
reload();
}
function reload(done: (() => void) | null): void {
function reload(done?: () => void): void {
const force = !!done;
if (!done) {
@@ -809,7 +809,7 @@ function changeDateFilter(dateType: number): void {
showDatePopover.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -833,7 +833,7 @@ function changeCustomDateFilter(minTime: number, maxTime: number): void {
showCustomDateRangeSheet.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -859,7 +859,7 @@ function shiftDateRange(minTime: number, maxTime: number, scale: number): void {
});
if (changed) {
reload(null);
reload();
}
}
@@ -898,7 +898,7 @@ function changeTypeFilter(type: number): void {
showMorePopover.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -914,7 +914,7 @@ function changeCategoryFilter(categoryIds: string): void {
showCategoryPopover.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -940,7 +940,7 @@ function changeAccountFilter(accountIds: string): void {
showAccountPopover.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -960,7 +960,7 @@ function changeTagFilter(tagIds: string): void {
showMorePopover.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -980,7 +980,7 @@ function changeTagFilterType(filterType: number): void {
showMorePopover.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -994,7 +994,7 @@ function changeKeywordFilter(keyword: string): void {
});
if (changed) {
reload(null);
reload();
}
}
@@ -1016,7 +1016,7 @@ function changeAmountFilter(filterType: string): void {
showMorePopover.value = false;
if (changed) {
reload(null);
reload();
}
}
@@ -1074,7 +1074,7 @@ function onPopoverOpen(event: { $el: Framework7Dom }): void {
function onPageAfterIn(): void {
if (transactionsStore.transactionListStateInvalid && !loading.value) {
reload(null);
reload();
}
routeBackOnError(props.f7router, loadingError);