show a confirmation dialog allowing the user to change the editable transaction range to "All" when unable to add or edit a transaction due to the limitation on the editable transaction range

This commit is contained in:
MaysWind
2024-09-20 00:47:53 +08:00
parent 6655d725ae
commit 5221ab481e
6 changed files with 88 additions and 5 deletions
+22 -1
View File
@@ -1059,7 +1059,28 @@ export default {
self.submitting = false;
self.$hideLoading();
if (!error.processed) {
if (error.error && (error.error.errorCode === apiConstants.transactionCannotCreateInThisTimeErrorCode || error.error.errorCode === apiConstants.transactionCannotModifyInThisTimeErrorCode)) {
self.$confirm('You have set this time range to prevent editing transactions. Would you like to change the editable transaction range to All?', () => {
self.submitting = true;
self.$showLoading(() => self.submitting);
self.userStore.updateUserTransactionEditScope({
transactionEditScope: transactionConstants.allTransactionEditScopeTypes.All.type
}).then(() => {
self.submitting = false;
self.$hideLoading();
self.$toast('Your editable transaction range has been set to All');
}).catch(error => {
self.submitting = false;
self.$hideLoading();
if (!error.processed) {
self.$toast(error.message || error);
}
});
});
} else if (!error.processed) {
self.$toast(error.message || error);
}
});