Add 'Reset everything' to the set-list menu (confirm + wipe localStorage)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5320da4325
commit
7207ffe1c7
1 changed files with 7 additions and 0 deletions
|
|
@ -235,6 +235,7 @@
|
|||
<button id="importBtn">⭱ Import file…</button>
|
||||
<input type="file" id="importFile" accept="application/json" style="display:none">
|
||||
<button id="clearLogBtn">🗑 Clear log</button>
|
||||
<button id="resetAllBtn" style="color:#ff7b6b">♻ Reset everything…</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -764,6 +765,11 @@ function renderLog() {
|
|||
box.innerHTML = html;
|
||||
}
|
||||
function clearLog() { if (confirm("Clear the practice log? (set lists & presets are kept)")) { lsSet(LS.logs, []); renderLog(); } }
|
||||
function resetAll() {
|
||||
if (!confirm("Reset EVERYTHING?\n\nThis permanently deletes all saved data on this device — presets, set lists, practice log and theme — and reloads the app to first-run state (demos restored). This cannot be undone.")) return;
|
||||
try { localStorage.clear(); } catch (e) {}
|
||||
location.replace(location.origin + location.pathname); // reload clean, no hash
|
||||
}
|
||||
|
||||
// --- backup: export / import everything (presets + set lists + logs) ---
|
||||
function exportAll() {
|
||||
|
|
@ -1007,6 +1013,7 @@ $("exportBtn").addEventListener("click", () => { $("trayMenu").hidden = true; ex
|
|||
$("importBtn").addEventListener("click", () => { $("trayMenu").hidden = true; $("importFile").click(); });
|
||||
$("importFile").addEventListener("change", (e) => { if (e.target.files[0]) importAll(e.target.files[0]); e.target.value = ""; });
|
||||
$("clearLogBtn").addEventListener("click", () => { $("trayMenu").hidden = true; clearLog(); });
|
||||
$("resetAllBtn").addEventListener("click", () => { $("trayMenu").hidden = true; resetAll(); });
|
||||
$("shareSettingsBtn").addEventListener("click", () => { $("trayMenu").hidden = true; shareSettings(); });
|
||||
$("shareSetlistBtn").addEventListener("click", () => { $("trayMenu").hidden = true; shareSetlist(); });
|
||||
$("shareClose").addEventListener("click", () => $("shareOverlay").hidden = true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue