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) {