Feature: Konto löschen (Play Store Pflicht) — DELETE /profile/account + Button in Settings (SW by-v786)
This commit is contained in:
parent
e8cf742911
commit
e4b170d45b
6 changed files with 59 additions and 7 deletions
|
|
@ -575,10 +575,10 @@
|
|||
<div id="modal-container"></div>
|
||||
|
||||
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
|
||||
<script src="/js/api.js?v=785"></script>
|
||||
<script src="/js/ui.js?v=785"></script>
|
||||
<script src="/js/app.js?v=785"></script>
|
||||
<script src="/js/worlds.js?v=785"></script>
|
||||
<script src="/js/api.js?v=786"></script>
|
||||
<script src="/js/ui.js?v=786"></script>
|
||||
<script src="/js/app.js?v=786"></script>
|
||||
<script src="/js/worlds.js?v=786"></script>
|
||||
|
||||
<!-- Feature-Seiten werden lazy geladen -->
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '785'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '786'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
|
|||
|
|
@ -287,6 +287,15 @@ window.Page_settings = (() => {
|
|||
<svg class="ph-icon" aria-hidden="true"><use href="/icons/phosphor.svg#sign-out"></use></svg>
|
||||
Abmelden
|
||||
</button>
|
||||
<button id="settings-delete-account-btn"
|
||||
style="width:100%;margin-top:var(--space-2);display:flex;align-items:center;justify-content:center;
|
||||
gap:var(--space-2);padding:var(--space-2) var(--space-4);
|
||||
border-radius:var(--radius-md);border:none;
|
||||
background:none;color:var(--c-text-muted);
|
||||
font-size:var(--text-xs);cursor:pointer">
|
||||
<svg class="ph-icon" aria-hidden="true" style="width:12px;height:12px"><use href="/icons/phosphor.svg#trash"></use></svg>
|
||||
Konto löschen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -789,6 +798,24 @@ window.Page_settings = (() => {
|
|||
_render();
|
||||
});
|
||||
|
||||
document.getElementById('settings-delete-account-btn')?.addEventListener('click', async () => {
|
||||
const ok = await UI.modal.confirm({
|
||||
title: 'Konto unwiderruflich löschen?',
|
||||
body: 'Alle deine Daten (Tagebuch, Gesundheit, Training, Fotos) werden dauerhaft gelöscht. Diese Aktion kann nicht rückgängig gemacht werden.',
|
||||
confirmText: 'Ja, Konto löschen',
|
||||
danger: true,
|
||||
});
|
||||
if (!ok) return;
|
||||
try {
|
||||
await API.del('/profile/account');
|
||||
_appState.user = null; _appState.dogs = []; _appState.activeDog = null;
|
||||
UI.toast.info('Dein Konto wurde gelöscht.');
|
||||
App.navigate('welcome');
|
||||
} catch {
|
||||
UI.toast.error('Konto konnte nicht gelöscht werden. Bitte versuche es erneut.');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('settings-install-btn')?.addEventListener('click', () => {
|
||||
App.navigate('welcome', true, { install: true });
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Offline-Cache + Push Notifications + Tile-Cache
|
||||
============================================================ */
|
||||
|
||||
const CACHE_VERSION = 'by-v785';
|
||||
const CACHE_VERSION = 'by-v786';
|
||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue