Skip to content

Commit

Permalink
fix: update information correctly on profile switch
Browse files Browse the repository at this point in the history
  • Loading branch information
XeroxDev committed Nov 27, 2021
1 parent 4e361d5 commit 6f56ca0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/actions/song-info.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class SongInfoAction extends DefaultAction<SongInfoAction> {

@SDOnActionEvent('willAppear')
public onContextAppear(event: WillAppearEvent): void {
this.reset();
this.socket.onTick$
.pipe(distinctUntilChanged(), takeUntil(this.destroy$))
.subscribe(async (data) => {
Expand Down Expand Up @@ -99,6 +100,16 @@ export class SongInfoAction extends DefaultAction<SongInfoAction> {
);
});
}
reset() {
this.titleIndex = 0;
this.authorIndex = 0;
this.albumIndex = 0;
this.currentTitle = '';
this.currentAuthor = '';
this.currentAlbum = '';
this.currentThumbnail = '';
this.currentUrl = '';
}

@SDOnActionEvent('willDisappear')
public onContextDisappear(event: WillDisappearEvent): void {
Expand Down

0 comments on commit 6f56ca0

Please sign in to comment.