Fix Clear Recently played

This commit is contained in:
itsmo-ks 2026-03-15 14:00:44 +00:00
parent 7b70e55895
commit abcc33ba38
2 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

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