automatically save transaction draft

This commit is contained in:
MaysWind
2024-09-22 14:41:35 +08:00
parent 49df497f35
commit 4c13b7ad02
16 changed files with 384 additions and 26 deletions
+4 -1
View File
@@ -39,6 +39,7 @@
import { mapStores } from 'pinia';
import { useSettingsStore } from '@/stores/setting.js';
import { useUserStore } from '@/stores/user.js';
import { useTransactionsStore } from '@/stores/transaction.js';
import logger from '@/lib/logger.js';
import webauthn from '@/lib/webauthn.js';
@@ -54,7 +55,7 @@ export default {
};
},
computed: {
...mapStores(useSettingsStore, useUserStore),
...mapStores(useSettingsStore, useUserStore, useTransactionsStore),
isEnableApplicationLock: {
get: function () {
return this.settingsStore.appSettings.applicationLock;
@@ -145,6 +146,7 @@ export default {
this.$user.encryptToken(user.username, pinCode);
this.settingsStore.setEnableApplicationLock(true);
this.transactionsStore.saveTransactionDraft();
this.settingsStore.setEnableApplicationLockWebAuthn(false);
this.$user.clearWebAuthnConfig();
@@ -169,6 +171,7 @@ export default {
this.$user.decryptToken();
this.settingsStore.setEnableApplicationLock(false);
this.transactionsStore.saveTransactionDraft();
this.settingsStore.setEnableApplicationLockWebAuthn(false);
this.$user.clearWebAuthnConfig();