add reset functionality in settings

This commit is contained in:
Danny Morabito 2025-04-03 20:32:20 +02:00
parent 1fa04fa4d9
commit ff01fc8503
Signed by: dannym
GPG key ID: 7CC8056A5A04557E
5 changed files with 49 additions and 14 deletions

View file

@ -117,6 +117,12 @@ export class EveSettings extends LitElement {
document.body.classList.toggle('dark', this.darkMode);
}
private reset() {
if (!confirm('Are you sure you want to reset the app?')) return;
localStorage.clear();
window.location.reload();
}
override render() {
if (this.error) return html`<arx-error-view .error=${this.error}></arx-error-view>`;
@ -196,6 +202,15 @@ export class EveSettings extends LitElement {
<arx-relay-logs .logs=${this.relayStatus.logs}></arx-relay-logs>
</arx-fieldset>
</arx-card>
<arx-card >
<arx-fieldset legend="Reset">
<p>
This will delete all the data stored on this device, and you will be sent back to the setup
screen.
</p>
<arx-button @click=${this.reset} label="Reset" variant="accent" fullWidth></arx-button>
</arx-fieldset>
</arx-card>
`;
}
}