UX: Kündigung-Toast zeigt Ablaufdatum (SW by-v949)

This commit is contained in:
rene 2026-05-14 16:41:52 +02:00
parent b3f1c6bdf3
commit 959fff4651
4 changed files with 14 additions and 4 deletions

View file

@ -422,7 +422,17 @@ window.Page_settings = (() => {
const fresh = await API.auth.me();
Object.assign(_appState.user, fresh);
UI.modal.close();
UI.toast.success('Kündigung bestätigt. Eine Bestätigungsmail wurde gesendet.');
const tier = fresh.subscription_tier || '';
const label = { pro: 'Pro', breeder: 'Züchter' }[tier] || tier;
const exp = fresh.subscription_expires_at;
const expFmt = exp
? new Date(exp).toLocaleDateString('de-DE', {day:'numeric',month:'long',year:'numeric'})
: null;
UI.toast.success(
expFmt
? `Kündigung bestätigt — ${label} läuft noch bis ${expFmt}.`
: 'Kündigung bestätigt. Eine Bestätigungsmail wurde gesendet.'
);
_render();
} catch (e) {
btn.disabled = false;