From abcc33ba380a755122c49733b86118579adc7850 Mon Sep 17 00:00:00 2001 From: itsmo-ks Date: Sun, 15 Mar 2026 14:00:44 +0000 Subject: [PATCH] Fix Clear Recently played --- js/accounts/pocketbase.js | 7 +++++++ js/ui.js | 1 + 2 files changed, 8 insertions(+) diff --git a/js/accounts/pocketbase.js b/js/accounts/pocketbase.js index e70b860..d9d4671 100644 --- a/js/accounts/pocketbase.js +++ b/js/accounts/pocketbase.js @@ -303,6 +303,13 @@ const syncManager = { await this._updateUserJSON(user.$id, 'history', newHistory); }, + async clearHistory() { + const user = authManager.user; + if (!user) return; + + await this._updateUserJSON(user.$id, 'history', []); + }, + async syncUserPlaylist(playlist, action) { const user = authManager.user; if (!user) return; diff --git a/js/ui.js b/js/ui.js index 1998434..87e21c3 100644 --- a/js/ui.js +++ b/js/ui.js @@ -4451,6 +4451,7 @@ export class UIRenderer { if (confirm('Clear all recently played tracks? This cannot be undone.')) { try { await db.clearHistory(); + await syncManager.clearHistory(); container.innerHTML = createPlaceholder("You haven't played any tracks yet."); clearBtn.style.display = 'none'; } catch (err) {