From 29272432379d48e6e27f786aef9d0880b10bd9c4 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 23 Nov 2025 14:57:00 +0800 Subject: [PATCH] [F] Fix next song --- src/routes/results/[id]/+page.server.ts | 3 ++- src/routes/results/[id]/+page.svelte | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/results/[id]/+page.server.ts b/src/routes/results/[id]/+page.server.ts index 66a0932..d11a21b 100644 --- a/src/routes/results/[id]/+page.server.ts +++ b/src/routes/results/[id]/+page.server.ts @@ -14,6 +14,7 @@ export const load: PageServerLoad = async ({ params, parent }) => { result: structuredClone(result), lrc: await getLyricsProcessed(result.songId), song, - playlist: await user.data?.loc?.currentPlaylistId?.let(getPlaylist) + playlist: await user.data?.loc?.currentPlaylistId?.let(getPlaylist), + resultId: params.id } } diff --git a/src/routes/results/[id]/+page.svelte b/src/routes/results/[id]/+page.svelte index cb12507..5e35d45 100644 --- a/src/routes/results/[id]/+page.svelte +++ b/src/routes/results/[id]/+page.svelte @@ -102,7 +102,7 @@ const loc = data.user.data.loc const playlist = data.playlist // 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 if (playlist && loc && isCurrentResult) {