show whether data is updated after pull down

This commit is contained in:
MaysWind
2023-06-18 22:43:47 +08:00
parent 55ad7b2e81
commit eb2e2b0a26
15 changed files with 102 additions and 17 deletions
+8 -2
View File
@@ -1,6 +1,7 @@
import { defineStore } from 'pinia';
import categoryConstants from '@/consts/category.js';
import { isEquals } from '@/lib/common.js';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
@@ -179,12 +180,17 @@ export const useTransactionCategoriesStore = defineStore('transactionCategories'
}
}
loadTransactionCategoryList(self, data.result);
if (self.transactionCategoryListStateInvalid) {
self.updateTransactionCategoryListInvalidState(false);
}
if (force && data.result && isEquals(self.allTransactionCategories, data.result)) {
reject({ message: 'Category list is up to date' });
return;
}
loadTransactionCategoryList(self, data.result);
resolve(data.result);
}).catch(error => {
if (force) {