This commit is contained in:
syuilo
2019-02-21 01:30:21 +09:00
parent 7174a55846
commit 3409a51cca
10 changed files with 253 additions and 29 deletions

View File

@ -101,6 +101,13 @@
<ui-button @click="doExport()"><fa :icon="faDownload"/> {{ $t('export') }}</ui-button>
</div>
</section>
<section>
<details>
<summary>{{ $t('danger-zone') }}</summary>
<ui-button @click="deleteAccount()">{{ $t('delete-account') }}</ui-button>
</details>
</section>
</ui-card>
</template>
@ -283,6 +290,25 @@ export default Vue.extend({
type: 'info',
text: this.$t('export-requested')
});
},
async deleteAccount() {
const { canceled: canceled, result: password } = await this.$root.dialog({
title: this.$t('enter-password'),
input: {
type: 'password'
}
});
if (canceled) return;
this.$root.api('i/delete-account', {
password
}).then(() => {
this.$root.dialog({
type: 'success',
text: this.$t('account-deleted')
});
});
}
}
});