reset state after leaving 2fa setting tab
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
</v-window-item>
|
||||
|
||||
<v-window-item value="twoFactorSetting">
|
||||
<user-two-factor-auth-setting-tab/>
|
||||
<user-two-factor-auth-setting-tab ref="twoFactorSettingTab"/>
|
||||
</v-window-item>
|
||||
|
||||
<v-window-item value="dataManagementSetting">
|
||||
@@ -69,6 +69,13 @@ export default {
|
||||
dataManagementSetting: mdiDatabaseCogOutline
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'activeTab': function (newValue, oldValue) {
|
||||
if (oldValue === 'twoFactorSetting' && newValue !== 'twoFactorSetting') {
|
||||
this.$refs.twoFactorSettingTab.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -116,6 +116,9 @@ import {
|
||||
} from '@mdi/js';
|
||||
|
||||
export default {
|
||||
expose: [
|
||||
'reset'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
status: null,
|
||||
@@ -165,6 +168,18 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
this.new2FASecret = '';
|
||||
this.new2FAQRCode = '';
|
||||
this.currentPassword = '';
|
||||
this.isCurrentPasswordVisible = false;
|
||||
this.currentPasscode = '';
|
||||
this.currentBackupCode = '';
|
||||
this.enabling = false;
|
||||
this.enableConfirming = false;
|
||||
this.disabling = false;
|
||||
this.regenerating = false;
|
||||
},
|
||||
enable() {
|
||||
const self = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user