feat: add delete all local data option in settings with keypair destruction
This commit is contained in:
@@ -85,6 +85,15 @@ class PageSettings extends HTMLElement {
|
||||
}
|
||||
})
|
||||
|
||||
// Delete all local data
|
||||
this.querySelector('#clear-all-data')?.addEventListener('click', async () => {
|
||||
if (confirm(t('settings.confirmDeleteAll'))) {
|
||||
await auth.clearAllData()
|
||||
window.location.hash = '#/'
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
|
||||
// Toggle UUID visibility
|
||||
this.querySelector('#toggle-uid-btn')?.addEventListener('click', () => {
|
||||
this.uidVisible = !this.uidVisible
|
||||
@@ -292,6 +301,16 @@ class PageSettings extends HTMLElement {
|
||||
${t('settings.clear')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div>
|
||||
<label>${t('settings.deleteAllData')}</label>
|
||||
<p class="setting-hint">${t('settings.deleteAllDataHint')}</p>
|
||||
</div>
|
||||
<button id="clear-all-data" class="btn btn-outline btn-sm btn-danger">
|
||||
${t('settings.deleteAll')}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- About -->
|
||||
|
||||
Reference in New Issue
Block a user