Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 committed Jan 29, 2025
1 parent e1279c9 commit 90b4350
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions web/src/lib/components/album-page/albums-list.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,12 @@
};
const updateRecentAlbumInfo = (album: AlbumResponseDto) => {
if (userInteraction.recentAlbums) {
const index = userInteraction.recentAlbums.findIndex((recentAlbum) => recentAlbum.id === album.id);
if (index !== -1) {
userInteraction.recentAlbums[index] = { ...userInteraction.recentAlbums[index], ...album };
for (const cachedAlbum of userInteraction.recentAlbums || []) {
if (cachedAlbum.id !== album.id) {
continue;
}
Object.assign(cachedAlbum, { ...cachedAlbum, ...album });
}
};
Expand Down

0 comments on commit 90b4350

Please sign in to comment.