[F] Fix next song
This commit is contained in:
@@ -14,6 +14,7 @@ export const load: PageServerLoad = async ({ params, parent }) => {
|
|||||||
result: structuredClone(result),
|
result: structuredClone(result),
|
||||||
lrc: await getLyricsProcessed(result.songId),
|
lrc: await getLyricsProcessed(result.songId),
|
||||||
song,
|
song,
|
||||||
playlist: await user.data?.loc?.currentPlaylistId?.let(getPlaylist)
|
playlist: await user.data?.loc?.currentPlaylistId?.let(getPlaylist),
|
||||||
|
resultId: params.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
const loc = data.user.data.loc
|
const loc = data.user.data.loc
|
||||||
const playlist = data.playlist
|
const playlist = data.playlist
|
||||||
// Check if this is the latest result for the current playlist session
|
// Check if this is the latest result for the current playlist session
|
||||||
const isCurrentResult = loc?.lastResultId === data.result._id
|
const isCurrentResult = loc?.lastResultId === data.resultId
|
||||||
|
|
||||||
// Compute next state immediately
|
// Compute next state immediately
|
||||||
if (playlist && loc && isCurrentResult) {
|
if (playlist && loc && isCurrentResult) {
|
||||||
|
|||||||
Reference in New Issue
Block a user