Create/edit/import dialog gets destroyed on close

This commit is contained in:
Gourav Kumar 2024-07-14 17:40:36 +05:30
parent a089ffa884
commit 5b697d7810

View File

@ -19,16 +19,31 @@ import ListSecrets from "./components/ListSecrets.vue";
</div>
</div>
<el-dialog v-model="creationDialog" title="Add a new TOTP secret" width="80vw">
<el-dialog
v-model="creationDialog"
title="Add a new TOTP secret"
destroy-on-close
width="80vw"
>
<CreateSecret @close="secretSaved" />
</el-dialog>
<el-dialog v-model="editDialog" title="Edit TOTP secret" width="80vw">
<el-dialog
v-model="editDialog"
title="Edit TOTP secret"
destroy-on-close
width="80vw"
>
<CreateSecret :editSecret="editingSecret" @close="secretSaved" />
</el-dialog>
<el-dialog v-model="importDialog" title="Import TOTP secrets" width="80vw">
<ImportSecrets />
<el-dialog
v-model="importDialog"
title="Import TOTP secrets"
destroy-on-close
width="80vw"
>
<ImportSecrets @close="secretsImported" />
</el-dialog>
<div class="container">
@ -80,6 +95,11 @@ export default {
this.listUpdated += 1;
},
secretsImported() {
this.importDialog = false;
this.listUpdated += 1;
},
async validateToken() {
const url = `${this.apiBaseUrl}/validate-token`;
const token = sessionStorage.getItem("token");