code refactor
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user