Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Settings: Delete my account
Duarte Santos3da21a9190b6
diff --git a/frontend/src/components/DeleteAccount.jsx b/frontend/src/components/DeleteAccount.jsxnew file mode 100644index 000000000..3fc9d5f20--- /dev/null+++ b/frontend/src/components/DeleteAccount.jsx@@ -0,0 +1,70 @@+// Settings → Account → "Delete my account" (App Store rule 5.1.1(v): an app you can sign up in+// lets you leave it from inside the app). The server removes the profile and everything in it+// (POST /api/account/delete, the same clean-up as the admin's delete); the store then leaves this+// device where a sign-out does (useStore deleteAccount). The sheet offers the backup export first+// (the very one Data & backup has, handed in by Settings), and the account's name has to be typed+// back before the button does anything. Shown only while signed in to or paired with a server: a+// phone in local-only mode has no account, and "Reset everything" is how it wipes its data.+import { useEffect, useRef, useState } from 'react'+import { useStore } from '../store/useStore.js'+import { useUI } from '../store/useUI.js'+import { t } from '../lib/i18n.js'+import { Row, Button } from './ui.jsx'++const errStyle = { color: 'var(--red)', marginTop: 10 }++// The server's answer in the UI language, by its `code` (api/openapi.yaml, /api/account/delete).+export function deleteAccountError(e) {+ switch (e?.data?.code) {+ case 'confirm-name': return t('That is not your account name.')+ case 'last-admin': return t('You’re the only admin here, and other profiles still use this server. Make someone else an admin first.')+ }+ return t('Couldn’t delete the account. Nothing was removed.')+}++export function DeleteAccountSheet({ close, exportBackup, exportBackupZip, hasMedia, done }) {+ const user = useStore(s => s.user)+ const [typed, setTyped] = useState('')+ const [busy, setBusy] = useState(false)+ const [err, setErr] = useState(null)+ const ref = useRef(null)+ const name = user?.name || ''+ const match = !!name && typed.trim() === name+ useEffect(() => { setTimeout(() => ref.current?.focus(), 250) }, [])+ const submit = async ev => {+ ev.preventDefault()+ if (busy || !match) return+ setBusy(true); setErr(null)+ try { await useStore.getState().deleteAccount(typed.trim()) }+ catch (e) { setErr(deleteAccountError(e)); setBusy(false); return }+ close()+ useUI.getState().toast(t('Your account is gone. Thanks for every rep.'))+ done?.()+ }+ return <>+ <h3>{t('Delete your account?')}</h3>+ <div className="muted small" style={{ marginBottom: 14, lineHeight: 1.5 }}>+ {t('Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.')}+ </div>+ <div className="small" style={{ marginBottom: 8 }}>{t('Want a copy first? Export a backup. You can import it into openGym anytime.')}</div>+ {hasMedia && exportBackupZip+ ? <Button icon="share" disabled={busy} onClick={exportBackupZip}>{t('Export with photos & videos (.zip)')}</Button>+ : <Button icon="share" disabled={busy} onClick={exportBackup}>{t('Export backup (JSON)')}</Button>}+ <form onSubmit={submit} noValidate style={{ marginTop: 18 }}>+ <label className="small" htmlFor="delete-account-name" style={{ display: 'block', marginBottom: 6 }}>{t('Type {0} to confirm.', name)}</label>+ <input ref={ref} id="delete-account-name" className="input" placeholder={t('Account name')} autoComplete="off"+ autoCapitalize="none" autoCorrect="off" spellCheck={false} value={typed} onChange={e => { setTyped(e.target.value); setErr(null) }} />+ {err && <div className="small" role="alert" style={errStyle}>{err}</div>}+ <div style={{ height: 14 }} />+ <button type="submit" className="btn danger" disabled={busy || !match}>{busy ? t('Deleting…') : t('Delete forever')}</button>+ </form>+ <div style={{ height: 8 }} />+ <Button variant="ghost" className="dim" disabled={busy} onClick={close}>{t('Cancel')}</Button>+ </>+}++// The row on the Account page. `done` runs once the account is gone (Settings goes home).+export function DeleteAccountRow(props) {+ const open = () => useUI.getState().openSheet(close => <DeleteAccountSheet {...props} close={close} />)+ return <Row icon="trash" iconTint="var(--red)" title={t('Delete my account')} subtitle={t('Removes your profile and everything in it from this server.')} danger onClick={open} />+}diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex 81526c083..5d5994fb3 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -41,7 +41,7 @@ describe('Brazilian Portuguese locale', () => {// has to be taught is a number nobody reads. What the numbers stood for is asserted above.// If the hash fails, review the changed keys and wording before accepting a new one. From// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('a1b9f9f1a9706b5fc6e5145ff6371e200e7481ea3dd6170d2dedca14f5792111')+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('216032f046ce2c36098a4a434d117bb1c33737f96c5a4eb7e377de0cfdcabb1d')})// pt-PT labelled Unpair 'Desfazer': Undo, in Portuguese (it is pt-BR's Undo), on the button thatdiff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 1be569f95..5fbcd44da 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -2297,4 +2297,18 @@ export default {'Your sports watch, calling you back.': 'ساعتك الرياضية تناديك للعودة.','Coach wants you back on the bar.': 'المدرب يريدك أن تعود إلى البار.','Gentle, for headphones or a quiet room.': 'هادئ، للسماعات أو لغرفة هادئة.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'حذف حسابي',+ 'Removes your profile and everything in it from this server.': 'يزيل ملفك الشخصي وكل ما فيه من هذا الخادم.',+ 'Delete your account?': 'حذف حسابك؟',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'سيُحذف ملفك الشخصي وتدريباتك ووزن جسمك وصورك ومقاطع الفيديو من هذا الخادم نهائيًا. لا تراجع، ولا حتى المسؤول يستطيع استعادتها.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'تريد نسخة أولًا؟ صدّر نسخة احتياطية. يمكنك استيرادها إلى openGym في أي وقت.',+ 'Type {0} to confirm.': 'اكتب {0} للتأكيد.',+ 'Account name': 'اسم الحساب',+ 'Deleting…': 'جارٍ الحذف…',+ 'Delete forever': 'حذف نهائي',+ 'That is not your account name.': 'هذا ليس اسم حسابك.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'أنت المسؤول الوحيد هنا، وملفات أخرى ما زالت تستخدم هذا الخادم. اجعل شخصًا آخر مسؤولًا أولًا.',+ 'Couldn’t delete the account. Nothing was removed.': 'تعذّر حذف الحساب. لم يُحذف أي شيء.',+ 'Your account is gone. Thanks for every rep.': 'حسابك لم يعد موجودًا. شكرًا على كل تكرار.',}diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.jsindex 6ad7a0339..03023a70d 100644--- a/frontend/src/locales/bn.js+++ b/frontend/src/locales/bn.js@@ -2321,4 +2321,18 @@ export default {'Your sports watch, calling you back.': 'আপনার স্পোর্টস ঘড়ি আপনাকে ফিরে ডাকছে।','Coach wants you back on the bar.': 'কোচ আপনাকে আবার বারে চান।','Gentle, for headphones or a quiet room.': 'মৃদু, হেডফোন বা শান্ত ঘরের জন্য।',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'আমার অ্যাকাউন্ট মুছুন',+ 'Removes your profile and everything in it from this server.': 'এই সার্ভার থেকে আপনার প্রোফাইল ও তার সবকিছু সরিয়ে দেয়।',+ 'Delete your account?': 'আপনার অ্যাকাউন্ট মুছবেন?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'আপনার প্রোফাইল, ওয়ার্কআউট, শরীরের ওজন, ছবি ও ভিডিও এই সার্ভার থেকে চিরতরে মুছে যাবে। ফেরানোর উপায় নেই, এমনকি আপনার অ্যাডমিনও ফিরিয়ে আনতে পারবেন না।',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'আগে একটা কপি চান? একটি ব্যাকআপ এক্সপোর্ট করুন। যেকোনো সময় openGym-এ ইমপোর্ট করতে পারবেন।',+ 'Type {0} to confirm.': 'নিশ্চিত করতে {0} লিখুন।',+ 'Account name': 'অ্যাকাউন্টের নাম',+ 'Deleting…': 'মোছা হচ্ছে…',+ 'Delete forever': 'চিরতরে মুছুন',+ 'That is not your account name.': 'এটি আপনার অ্যাকাউন্টের নাম নয়।',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'আপনি এখানে একমাত্র অ্যাডমিন, আর অন্য প্রোফাইলগুলো এখনও এই সার্ভার ব্যবহার করছে। আগে অন্য কাউকে অ্যাডমিন করুন।',+ 'Couldn’t delete the account. Nothing was removed.': 'অ্যাকাউন্ট মোছা যায়নি। কিছুই সরানো হয়নি।',+ 'Your account is gone. Thanks for every rep.': 'আপনার অ্যাকাউন্ট মুছে গেছে। প্রতিটি রেপের জন্য ধন্যবাদ।',}diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex 1a9cdb60a..971517908 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -2262,4 +2262,18 @@ export default {'Your sports watch, calling you back.': 'Deine Sportuhr ruft dich zurück.','Coach wants you back on the bar.': 'Der Coach will dich zurück an der Stange.','Gentle, for headphones or a quiet room.': 'Leise, für Kopfhörer oder einen ruhigen Raum.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Mein Konto löschen',+ 'Removes your profile and everything in it from this server.': 'Entfernt dein Profil und alles darin von diesem Server.',+ 'Delete your account?': 'Konto löschen?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Dein Profil, deine Trainings, dein Körpergewicht, Fotos und Videos werden endgültig von diesem Server gelöscht. Es gibt kein Zurück, nicht einmal dein Admin kann sie zurückholen.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Lieber erst eine Kopie? Exportiere ein Backup. Du kannst es jederzeit wieder in openGym importieren.',+ 'Type {0} to confirm.': 'Gib {0} ein, um zu bestätigen.',+ 'Account name': 'Kontoname',+ 'Deleting…': 'Wird gelöscht…',+ 'Delete forever': 'Endgültig löschen',+ 'That is not your account name.': 'Das ist nicht dein Kontoname.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Du bist hier der einzige Admin, und andere Profile nutzen diesen Server noch. Mach zuerst jemand anderen zum Admin.',+ 'Couldn’t delete the account. Nothing was removed.': 'Das Konto konnte nicht gelöscht werden. Es wurde nichts entfernt.',+ 'Your account is gone. Thanks for every rep.': 'Dein Konto ist weg. Danke für jede Wiederholung.',}diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 660464b3c..ea7b14c4e 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': 'Tu reloj deportivo te llama de vuelta.','Coach wants you back on the bar.': 'El coach te quiere de vuelta en la barra.','Gentle, for headphones or a quiet room.': 'Suave, para auriculares o una sala tranquila.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Eliminar mi cuenta',+ 'Removes your profile and everything in it from this server.': 'Borra tu perfil y todo lo que contiene de este servidor.',+ 'Delete your account?': '¿Eliminar tu cuenta?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Tu perfil, entrenamientos, peso corporal, fotos y vídeos se borran de este servidor para siempre. No hay vuelta atrás, ni siquiera tu administrador puede recuperarlos.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': '¿Quieres una copia antes? Exporta una copia de seguridad. Puedes importarla en openGym cuando quieras.',+ 'Type {0} to confirm.': 'Escribe {0} para confirmar.',+ 'Account name': 'Nombre de la cuenta',+ 'Deleting…': 'Eliminando…',+ 'Delete forever': 'Eliminar para siempre',+ 'That is not your account name.': 'Ese no es el nombre de tu cuenta.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Eres el único administrador aquí y otros perfiles siguen usando este servidor. Haz administrador a otra persona primero.',+ 'Couldn’t delete the account. Nothing was removed.': 'No se pudo eliminar la cuenta. No se borró nada.',+ 'Your account is gone. Thanks for every rep.': 'Tu cuenta ya no existe. Gracias por cada repetición.',}diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex fb06833e3..5a40e1099 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': 'Ta montre de sport te rappelle.','Coach wants you back on the bar.': 'Le coach te veut de retour à la barre.','Gentle, for headphones or a quiet room.': 'Tout doux, pour un casque ou une pièce calme.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Supprimer mon compte',+ 'Removes your profile and everything in it from this server.': 'Efface ton profil et tout son contenu de ce serveur.',+ 'Delete your account?': 'Supprimer ton compte ?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Ton profil, tes séances, ton poids corporel, tes photos et tes vidéos sont effacés de ce serveur pour de bon. Pas de retour en arrière, même ton admin ne pourra rien récupérer.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Une copie d’abord ? Exporte une sauvegarde. Tu pourras l’importer dans openGym quand tu veux.',+ 'Type {0} to confirm.': 'Tape {0} pour confirmer.',+ 'Account name': 'Nom du compte',+ 'Deleting…': 'Suppression…',+ 'Delete forever': 'Supprimer pour de bon',+ 'That is not your account name.': 'Ce n’est pas le nom de ton compte.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Tu es le seul admin ici, et d’autres profils utilisent encore ce serveur. Nomme d’abord quelqu’un d’autre admin.',+ 'Couldn’t delete the account. Nothing was removed.': 'Impossible de supprimer le compte. Rien n’a été effacé.',+ 'Your account is gone. Thanks for every rep.': 'Ton compte n’existe plus. Merci pour chaque répétition.',}diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 2de04e8cf..fc8be6c73 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': 'आपकी स्पोर्ट्स घड़ी आपको वापस बुला रही है।','Coach wants you back on the bar.': 'कोच आपको बार पर वापस चाहते हैं।','Gentle, for headphones or a quiet room.': 'धीमी, हेडफ़ोन या शांत कमरे के लिए।',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'मेरा खाता हटाएँ',+ 'Removes your profile and everything in it from this server.': 'इस सर्वर से आपकी प्रोफ़ाइल और उसमें मौजूद सब कुछ हटा देता है।',+ 'Delete your account?': 'अपना खाता हटाएँ?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'आपकी प्रोफ़ाइल, वर्कआउट, शरीर का वज़न, फ़ोटो और वीडियो इस सर्वर से हमेशा के लिए हट जाएँगे। इसे वापस नहीं लिया जा सकता, आपके एडमिन भी इन्हें वापस नहीं ला सकते।',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'पहले एक कॉपी चाहिए? बैकअप निर्यात करें। आप उसे कभी भी openGym में आयात कर सकते हैं।',+ 'Type {0} to confirm.': 'पुष्टि के लिए {0} लिखें।',+ 'Account name': 'खाते का नाम',+ 'Deleting…': 'हटाया जा रहा है…',+ 'Delete forever': 'हमेशा के लिए हटाएँ',+ 'That is not your account name.': 'यह आपके खाते का नाम नहीं है।',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'आप यहाँ के अकेले एडमिन हैं, और दूसरी प्रोफ़ाइलें अभी भी यह सर्वर इस्तेमाल करती हैं। पहले किसी और को एडमिन बनाएँ।',+ 'Couldn’t delete the account. Nothing was removed.': 'खाता हटाया नहीं जा सका। कुछ भी नहीं हटाया गया।',+ 'Your account is gone. Thanks for every rep.': 'आपका खाता हट गया। हर रेप के लिए धन्यवाद।',}diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 42247c680..5342fae8e 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -2245,4 +2245,18 @@ export default {'Your sports watch, calling you back.': 'A sportórád visszahív.','Coach wants you back on the bar.': 'Az edző visszavár a rúdhoz.','Gentle, for headphones or a quiet room.': 'Halk, fülhallgatóhoz vagy csendes helyre.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Fiókom törlése',+ 'Removes your profile and everything in it from this server.': 'Eltávolítja a profilodat és mindent, ami benne van, erről a szerverről.',+ 'Delete your account?': 'Törlöd a fiókodat?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'A profilod, edzéseid, testsúlyod, fotóid és videóid végleg törlődnek erről a szerverről. Nincs visszaút, még az adminod sem tudja visszahozni őket.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Előbb egy másolat? Exportálj egy biztonsági mentést. Bármikor visszaimportálhatod az openGymbe.',+ 'Type {0} to confirm.': 'A megerősítéshez írd be: {0}',+ 'Account name': 'Fiók neve',+ 'Deleting…': 'Törlés…',+ 'Delete forever': 'Végleges törlés',+ 'That is not your account name.': 'Ez nem a fiókod neve.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Te vagy itt az egyetlen admin, és más profilok még használják ezt a szervert. Előbb tegyél meg valaki mást adminnak.',+ 'Couldn’t delete the account. Nothing was removed.': 'Nem sikerült törölni a fiókot. Semmi sem lett eltávolítva.',+ 'Your account is gone. Thanks for every rep.': 'A fiókod eltűnt. Köszönjük az összes ismétlést.',}diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex fe8f5ec5c..0102eadfa 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': 'Il tuo orologio sportivo ti richiama.','Coach wants you back on the bar.': 'Il coach ti vuole di nuovo al bilanciere.','Gentle, for headphones or a quiet room.': 'Delicato, per le cuffie o una stanza silenziosa.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Elimina il mio account',+ 'Removes your profile and everything in it from this server.': 'Rimuove il tuo profilo e tutto ciò che contiene da questo server.',+ 'Delete your account?': 'Eliminare il tuo account?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Profilo, allenamenti, peso corporeo, foto e video vengono cancellati da questo server per sempre. Non si torna indietro, nemmeno il tuo admin può recuperarli.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Prima una copia? Esporta un backup. Puoi importarlo in openGym quando vuoi.',+ 'Type {0} to confirm.': 'Scrivi {0} per confermare.',+ 'Account name': 'Nome dell’account',+ 'Deleting…': 'Eliminazione…',+ 'Delete forever': 'Elimina per sempre',+ 'That is not your account name.': 'Questo non è il nome del tuo account.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Sei l’unico admin qui e altri profili usano ancora questo server. Prima nomina admin qualcun altro.',+ 'Couldn’t delete the account. Nothing was removed.': 'Impossibile eliminare l’account. Non è stato rimosso nulla.',+ 'Your account is gone. Thanks for every rep.': 'Il tuo account non c’è più. Grazie per ogni ripetizione.',}diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 651cbf52c..848dca9af 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': '스포츠 시계가 다시 부르고 있어요.','Coach wants you back on the bar.': '코치가 바 앞으로 돌아오래요.','Gentle, for headphones or a quiet room.': '이어폰이나 조용한 곳에 어울려요.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': '내 계정 삭제',+ 'Removes your profile and everything in it from this server.': '이 서버에서 프로필과 그 안의 모든 것을 지워요.',+ 'Delete your account?': '계정을 삭제할까요?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': '프로필, 운동, 체중, 사진과 동영상이 이 서버에서 영구히 삭제돼요. 되돌릴 수 없고, 관리자도 복구할 수 없어요.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': '먼저 사본을 받아 둘까요? 백업을 내보내세요. 언제든 openGym으로 다시 가져올 수 있어요.',+ 'Type {0} to confirm.': '확인하려면 {0}을(를) 입력하세요.',+ 'Account name': '계정 이름',+ 'Deleting…': '삭제 중…',+ 'Delete forever': '영구 삭제',+ 'That is not your account name.': '계정 이름이 맞지 않아요.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': '이 서버의 유일한 관리자인데 다른 프로필이 아직 사용 중이에요. 먼저 다른 사람을 관리자로 지정하세요.',+ 'Couldn’t delete the account. Nothing was removed.': '계정을 삭제하지 못했어요. 아무것도 지워지지 않았어요.',+ 'Your account is gone. Thanks for every rep.': '계정이 삭제됐어요. 모든 반복에 감사해요.',}diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex b072d2def..3ef5273c6 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': 'Zegarek sportowy wzywa z powrotem.','Coach wants you back on the bar.': 'Trener czeka przy sztandze.','Gentle, for headphones or a quiet room.': 'Cichy, do słuchawek albo spokojnego pomieszczenia.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Usuń moje konto',+ 'Removes your profile and everything in it from this server.': 'Usuwa Twój profil i wszystko, co w nim jest, z tego serwera.',+ 'Delete your account?': 'Usunąć konto?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Twój profil, treningi, masa ciała, zdjęcia i filmy zostaną usunięte z tego serwera na zawsze. Nie da się tego cofnąć, nawet Twój administrator ich nie odzyska.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Najpierw kopia? Wyeksportuj kopię zapasową. Możesz ją zaimportować do openGym w każdej chwili.',+ 'Type {0} to confirm.': 'Wpisz {0}, aby potwierdzić.',+ 'Account name': 'Nazwa konta',+ 'Deleting…': 'Usuwanie…',+ 'Delete forever': 'Usuń na zawsze',+ 'That is not your account name.': 'To nie jest nazwa Twojego konta.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Jesteś tu jedynym administratorem, a inne profile wciąż korzystają z tego serwera. Najpierw zrób administratorem kogoś innego.',+ 'Couldn’t delete the account. Nothing was removed.': 'Nie udało się usunąć konta. Nic nie zostało usunięte.',+ 'Your account is gone. Thanks for every rep.': 'Twojego konta już nie ma. Dzięki za każde powtórzenie.',}diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex d822c0263..8091af717 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -1403,6 +1403,19 @@ export const PT_BR_OVERRIDES = {'Gentle, for headphones or a quiet room.': 'Suave, para fones de ouvido ou um lugar silencioso.','Fewer than two workouts in this period. Pick a longer one.': 'Menos de dois treinos neste período. Escolha um mais longo.','Releases are checked on GitHub. The download is verified against its checksum before the installer opens.': 'As versões são verificadas no GitHub. O download é conferido pela soma de verificação antes de abrir o instalador.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Excluir minha conta',+ 'Removes your profile and everything in it from this server.': 'Remove seu perfil e tudo o que há nele deste servidor.',+ 'Delete your account?': 'Excluir sua conta?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Seu perfil, treinos, peso corporal, fotos e vídeos são apagados deste servidor para sempre. Não tem volta, nem seu administrador consegue recuperá-los.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Quer uma cópia antes? Exporte um backup. Você pode importá-lo no openGym quando quiser.',+ 'Type {0} to confirm.': 'Digite {0} para confirmar.',+ 'Deleting…': 'Excluindo…',+ 'Delete forever': 'Excluir para sempre',+ 'That is not your account name.': 'Esse não é o nome da sua conta.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Você é o único administrador aqui e outros perfis ainda usam este servidor. Torne outra pessoa administradora primeiro.',+ 'Couldn’t delete the account. Nothing was removed.': 'Não foi possível excluir a conta. Nada foi removido.',+ 'Your account is gone. Thanks for every rep.': 'Sua conta não existe mais. Obrigado por cada repetição.',}export default { ...pt, ...PT_BR_OVERRIDES }diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex af227d65b..83d200623 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': 'O teu relógio desportivo a chamar-te de volta.','Coach wants you back on the bar.': 'O coach quer-te de volta à barra.','Gentle, for headphones or a quiet room.': 'Suave, para auscultadores ou uma sala sossegada.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Eliminar a minha conta',+ 'Removes your profile and everything in it from this server.': 'Remove o teu perfil e tudo o que tem deste servidor.',+ 'Delete your account?': 'Eliminar a tua conta?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'O teu perfil, treinos, peso corporal, fotos e vídeos são apagados deste servidor para sempre. Não há volta atrás, nem o teu administrador os consegue recuperar.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Queres uma cópia primeiro? Exporta uma cópia de segurança. Podes importá-la no openGym quando quiseres.',+ 'Type {0} to confirm.': 'Escreve {0} para confirmar.',+ 'Account name': 'Nome da conta',+ 'Deleting…': 'A eliminar…',+ 'Delete forever': 'Eliminar para sempre',+ 'That is not your account name.': 'Esse não é o nome da tua conta.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'És o único administrador aqui e outros perfis ainda usam este servidor. Torna outra pessoa administradora primeiro.',+ 'Couldn’t delete the account. Nothing was removed.': 'Não foi possível eliminar a conta. Nada foi removido.',+ 'Your account is gone. Thanks for every rep.': 'A tua conta já não existe. Obrigado por cada repetição.',}diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 870adabb1..76a136b19 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -2246,4 +2246,18 @@ export default {'Your sports watch, calling you back.': 'Ваши спортивные часы зовут вас обратно.','Coach wants you back on the bar.': 'Тренер ждёт вас обратно у штанги.','Gentle, for headphones or a quiet room.': 'Тихий, для наушников или спокойного зала.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Удалить мой аккаунт',+ 'Removes your profile and everything in it from this server.': 'Удаляет ваш профиль и всё, что в нём есть, с этого сервера.',+ 'Delete your account?': 'Удалить аккаунт?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Ваш профиль, тренировки, вес тела, фото и видео будут удалены с этого сервера навсегда. Отменить нельзя, даже администратор не сможет их вернуть.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Сначала копию? Экспортируйте резервную копию. Её можно импортировать в openGym в любой момент.',+ 'Type {0} to confirm.': 'Введите {0} для подтверждения.',+ 'Account name': 'Имя аккаунта',+ 'Deleting…': 'Удаление…',+ 'Delete forever': 'Удалить навсегда',+ 'That is not your account name.': 'Это не имя вашего аккаунта.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Вы здесь единственный администратор, а другие профили ещё пользуются этим сервером. Сначала назначьте администратором кого-то другого.',+ 'Couldn’t delete the account. Nothing was removed.': 'Не удалось удалить аккаунт. Ничего не удалено.',+ 'Your account is gone. Thanks for every rep.': 'Ваш аккаунт удалён. Спасибо за каждое повторение.',}diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex e0ffccc9c..121849fe0 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -2253,4 +2253,18 @@ export default {'Your sports watch, calling you back.': 'นาฬิกาสปอร์ตเรียกคุณกลับมาแล้ว','Coach wants you back on the bar.': 'โค้ชอยากให้คุณกลับมาที่บาร์','Gentle, for headphones or a quiet room.': 'เบา ๆ สำหรับหูฟังหรือห้องที่เงียบ',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'ลบบัญชีของฉัน',+ 'Removes your profile and everything in it from this server.': 'ลบโปรไฟล์ของคุณและทุกอย่างในนั้นออกจากเซิร์ฟเวอร์นี้',+ 'Delete your account?': 'ลบบัญชีของคุณใช่ไหม',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'โปรไฟล์ การออกกำลังกาย น้ำหนักตัว รูปภาพ และวิดีโอของคุณจะถูกลบออกจากเซิร์ฟเวอร์นี้อย่างถาวร ย้อนกลับไม่ได้ แม้แต่ผู้ดูแลระบบก็กู้คืนไม่ได้',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'อยากเก็บสำเนาไว้ก่อนไหม ส่งออกข้อมูลสำรองได้เลย แล้วนำเข้า openGym ได้ทุกเมื่อ',+ 'Type {0} to confirm.': 'พิมพ์ {0} เพื่อยืนยัน',+ 'Account name': 'ชื่อบัญชี',+ 'Deleting…': 'กำลังลบ…',+ 'Delete forever': 'ลบถาวร',+ 'That is not your account name.': 'นี่ไม่ใช่ชื่อบัญชีของคุณ',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'คุณเป็นผู้ดูแลระบบคนเดียวที่นี่ และยังมีโปรไฟล์อื่นใช้เซิร์ฟเวอร์นี้อยู่ ตั้งคนอื่นเป็นผู้ดูแลระบบก่อน',+ 'Couldn’t delete the account. Nothing was removed.': 'ลบบัญชีไม่สำเร็จ ไม่มีอะไรถูกลบ',+ 'Your account is gone. Thanks for every rep.': 'บัญชีของคุณถูกลบแล้ว ขอบคุณสำหรับทุกเรป',}diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex cfebb52e3..e949cf915 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': 'Spor saatin seni geri çağırıyor.','Coach wants you back on the bar.': 'Koç seni bara geri bekliyor.','Gentle, for headphones or a quiet room.': 'Sakin, kulaklık ya da sessiz bir oda için.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Hesabımı sil',+ 'Removes your profile and everything in it from this server.': 'Profilini ve içindeki her şeyi bu sunucudan kaldırır.',+ 'Delete your account?': 'Hesabın silinsin mi?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Profilin, antrenmanların, vücut ağırlığın, fotoğrafların ve videoların bu sunucudan kalıcı olarak silinir. Geri dönüşü yok, yöneticin bile geri getiremez.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Önce bir kopya mı? Bir yedek dışa aktar. İstediğin zaman openGym’e geri aktarabilirsin.',+ 'Type {0} to confirm.': 'Onaylamak için {0} yaz.',+ 'Account name': 'Hesap adı',+ 'Deleting…': 'Siliniyor…',+ 'Delete forever': 'Kalıcı olarak sil',+ 'That is not your account name.': 'Bu senin hesap adın değil.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Buradaki tek yönetici sensin ve başka profiller bu sunucuyu hâlâ kullanıyor. Önce başka birini yönetici yap.',+ 'Couldn’t delete the account. Nothing was removed.': 'Hesap silinemedi. Hiçbir şey kaldırılmadı.',+ 'Your account is gone. Thanks for every rep.': 'Hesabın silindi. Her tekrar için teşekkürler.',}diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex 15e561678..585a9455b 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -2239,4 +2239,18 @@ export default {'Your sports watch, calling you back.': 'Ваш спортивний годинник кличе вас назад.','Coach wants you back on the bar.': 'Тренер чекає вас назад біля штанги.','Gentle, for headphones or a quiet room.': 'Тихий, для навушників або спокійної кімнати.',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': 'Видалити мій акаунт',+ 'Removes your profile and everything in it from this server.': 'Видаляє ваш профіль і все, що в ньому є, з цього сервера.',+ 'Delete your account?': 'Видалити акаунт?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': 'Ваш профіль, тренування, вага тіла, фото й відео будуть видалені з цього сервера назавжди. Скасувати не можна, навіть адміністратор не зможе їх повернути.',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': 'Спершу копію? Експортуйте резервну копію. Її можна імпортувати в openGym будь-коли.',+ 'Type {0} to confirm.': 'Введіть {0} для підтвердження.',+ 'Account name': 'Назва акаунта',+ 'Deleting…': 'Видалення…',+ 'Delete forever': 'Видалити назавжди',+ 'That is not your account name.': 'Це не назва вашого акаунта.',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': 'Ви тут єдиний адміністратор, а інші профілі ще користуються цим сервером. Спершу призначте адміністратором когось іншого.',+ 'Couldn’t delete the account. Nothing was removed.': 'Не вдалося видалити акаунт. Нічого не видалено.',+ 'Your account is gone. Thanks for every rep.': 'Ваш акаунт видалено. Дякуємо за кожне повторення.',}diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.jsindex eaed2d6e5..57ab42611 100644--- a/frontend/src/locales/zh-TW.js+++ b/frontend/src/locales/zh-TW.js@@ -2235,4 +2235,18 @@ export default {'Your sports watch, calling you back.': '你的運動手錶在叫你回來。','Coach wants you back on the bar.': '教練等你回到槓鈴前。','Gentle, for headphones or a quiet room.': '輕柔,適合耳機或安靜的房間。',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': '刪除我的帳號',+ 'Removes your profile and everything in it from this server.': '從此伺服器上刪除你的個人檔案及其中的所有內容。',+ 'Delete your account?': '刪除你的帳號?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': '你的個人檔案、訓練、體重、相片和影片將從此伺服器永久刪除。無法復原,連管理員也救不回來。',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': '想先留一份?匯出一個備份。隨時都能再匯入 openGym。',+ 'Type {0} to confirm.': '輸入 {0} 以確認。',+ 'Account name': '帳號名稱',+ 'Deleting…': '正在刪除…',+ 'Delete forever': '永久刪除',+ 'That is not your account name.': '這不是你的帳號名稱。',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': '你是這裡唯一的管理員,而且還有其他個人檔案在使用此伺服器。請先讓其他人成為管理員。',+ 'Couldn’t delete the account. Nothing was removed.': '無法刪除帳號。沒有刪除任何內容。',+ 'Your account is gone. Thanks for every rep.': '你的帳號已刪除。感謝每一次訓練。',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex 134fd4544..c44154a71 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -2242,4 +2242,18 @@ export default {'Your sports watch, calling you back.': '你的运动手表在叫你回来。','Coach wants you back on the bar.': '教练等你回到杠铃前。','Gentle, for headphones or a quiet room.': '轻柔,适合耳机或安静的房间。',+ // --- delete my account (App Store rule 5.1.1(v)) ---+ 'Delete my account': '删除我的账号',+ 'Removes your profile and everything in it from this server.': '从此服务器上删除你的档案及其中的所有内容。',+ 'Delete your account?': '删除你的账号?',+ 'Your profile, workouts, body weight, photos and videos are deleted from this server for good. There is no undo, and not even your admin can bring them back.': '你的档案、训练、体重、照片和视频将从此服务器永久删除。无法撤销,连管理员也无法找回。',+ 'Want a copy first? Export a backup. You can import it into openGym anytime.': '想先留一份?导出一个备份。随时可以再导入 openGym。',+ 'Type {0} to confirm.': '输入 {0} 以确认。',+ 'Account name': '账号名称',+ 'Deleting…': '正在删除…',+ 'Delete forever': '永久删除',+ 'That is not your account name.': '这不是你的账号名称。',+ 'You’re the only admin here, and other profiles still use this server. Make someone else an admin first.': '你是这里唯一的管理员,而且还有其他档案在使用此服务器。请先让其他人成为管理员。',+ 'Couldn’t delete the account. Nothing was removed.': '无法删除账号。没有删除任何内容。',+ 'Your account is gone. Thanks for every rep.': '你的账号已删除。感谢每一次训练。',}diff --git a/frontend/src/store/useStore.js b/frontend/src/store/useStore.jsindex cfb1bd495..a060b3b32 100644--- a/frontend/src/store/useStore.js+++ b/frontend/src/store/useStore.js@@ -1823,6 +1823,29 @@ export const useStore = create((set, get) => {return left.owed ? owedResult(left, { stashed: true }) : { owed: false }},+ // Settings → "Delete my account": the server removes the profile and everything of it+ // (POST /api/account/delete, `name` typed back to confirm), then this device ends where a+ // sign-out leaves it, and a phone goes back to local-only as a disconnect does. Nothing is+ // kept aside: there is no account left for kept changes or a running workout to come back to.+ // The request is not swallowed: refused (the name, the last admin) or not answered, nothing+ // here changes and the caller says why.+ async deleteAccount(name) {+ const uid = get().user?.id+ await api('/api/account/delete', { method: 'POST', body: JSON.stringify({ name }) })+ await stopTimers()+ const all = await readStashes()+ const key = stashKey(serverBase(), uid)+ if (all[key]) { delete all[key]; await writeStashes(all) }+ await clearLocalSession()+ if (MOBILE) {+ await forgetRemote()+ pairedBase = null+ setSync({ server: null })+ get().setGuest(true)+ set({ ready: true })+ }+ },+// Demo build only: drop the seeded example profile back in (Settings → "Reset demo data").// Dynamic import so the generator never ships in a self-hosted bundle.async resetDemo() {diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex 490c22675..e9beafb5c 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -43,6 +43,7 @@ import BackupFolderRow, { useBackupFolder, autoBackupSubtitle } from '../componeimport { ServerSyncSection, KeptChangesRows, leaveServer, connectServer, passkeySignIn } from '../components/ServerSync.jsx'import { passwordOn, PasswordRow, openPasswordSignIn, openPasswordRegister } from '../components/PasswordAuth.jsx'import { usePasskeys, PasskeysRow, DeviceLinkRow, openDeviceLinkRedeem } from '../components/Passkeys.jsx'+import { DeleteAccountRow } from '../components/DeleteAccount.jsx'import { Section, Row, SelectRow, Switch, Segmented, Button, TextField, SearchField } from '../components/ui.jsx'import { PAGES, ROOT_GROUPS, pageVisible, searchSettings, pageTrail } from './settings-pages.js'@@ -899,6 +900,11 @@ export default function Settings({ page = null, find = null, via = null }) {<KeptChangesRows /></>}</Section>}+ {/* Signed in or paired: the account can be deleted from here (App Store rule 5.1.1(v)). A+ phone in local-only mode has no account; "Reset everything" in Data & backup wipes it. */}+ {user && !DEMO && <Section>+ <DeleteAccountRow exportBackup={doExport} exportBackupZip={doExportZip} hasMedia={hasMedia} done={() => nav('/home')} />+ </Section>}{/* The connection banner already says this to a guest; the line is for when it is switchedoff, or its × hid it (#454). */}{!user && !DEMO && !MOBILE && !(showsConnection(S) && showsLocalLine(S)) && <p className="sect-f" style={{ marginTop: -18, marginBottom: 22 }}>{t('Guest mode: your data lives only in this browser.')}</p>}diff --git a/frontend/src/views/settings-pages.js b/frontend/src/views/settings-pages.jsindex 5b6736125..9a3614180 100644--- a/frontend/src/views/settings-pages.js+++ b/frontend/src/views/settings-pages.js@@ -134,6 +134,7 @@ export const SEARCH = [{ page: 'account', title: 'Password', icon: 'key', tint: 'var(--orange)', kw: 'password login', when: c => signedInWeb(c) && c.pwOn },{ page: 'account', title: 'Sign out', icon: 'signOut', tint: 'var(--red)', kw: 'log out logout sign out', when: signedInWeb },{ page: 'account', title: 'Sign out everywhere', icon: 'shield', tint: 'var(--red)', kw: 'log out all devices sessions', when: signedInWeb },+ { page: 'account', title: 'Delete my account', icon: 'trash', tint: 'var(--red)', kw: 'delete remove close erase account profile gdpr', when: c => !!c.user && !c.demo },{ page: 'account', title: 'Account ID', icon: 'personCircle', tint: 'var(--grey)', kw: 'id uid admin account', when: c => !!c.user && !c.demo },{ page: 'account', title: 'Admin dashboard', icon: 'crown', tint: 'var(--indigo)', kw: 'admin users dashboard', when: c => !!c.user?.admin && !c.demo },{ page: 'account', title: 'Disconnect', icon: 'signOut', tint: 'var(--red)', kw: 'disconnect server local', when: c => c.mobile && !!c.user },