Skip to content

Commit

Permalink
make sure to clear currently shown tracks when changing user
Browse files Browse the repository at this point in the history
  • Loading branch information
StigNygaard committed Sep 28, 2024
1 parent f02d823 commit 8cbd3fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion widgets/lastfm.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ class Tracks extends HTMLElement {
this.#dispatchStateChange();
if (userChanged || widgetModeChanged) {
this.#scrobbles.clearUpdatesState();
this.shadowRoot.getElementById('playlist')?.replaceChildren(); // clear currently shown tracks
console.log(`Tracks User/WidgetMode has changed to ${this.#user}/${this.#widgetMode} - Update profile-header and tracklist now...`);
this.#profile.setup();
this.#scrobbles.update();
Expand Down Expand Up @@ -521,7 +522,7 @@ class Tracks extends HTMLElement {
return it.#fetcher(url.href)
.then((o) => {
if (o.error) {
if ([10,26,29].includes(o.error)) {
if ([10,17,26,29].includes(o.error)) { // 17: "Login: User required to be logged in"
updatesCanceled = true;
console.error(`Tracks widget: ⛔ Updates has stopped because error: ${o.error} - ${o.message} !`)
}
Expand Down

0 comments on commit 8cbd3fd

Please sign in to comment.