fix: sync reactive state with data prop using \$effect

Replaces bare \$state(data.x) initialisers (which only capture the
initial value) with \$state + \$effect pairs so that state stays in sync
whenever page data is invalidated or the URL changes. Affects all list
pages (searchValue) and all edit/detail pages (form fields).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 11:06:30 +01:00
parent dc1850126b
commit b9b98f178f
13 changed files with 60 additions and 0 deletions

View File

@@ -30,6 +30,10 @@
const timeAgo = new TimeAgo("en");
let isLiked = $state(data.likeStatus.liked);
let likesCount = $state(data.video.likes_count || 0);
$effect(() => {
isLiked = data.likeStatus.liked;
likesCount = data.video.likes_count || 0;
});
let isLikeLoading = $state(false);
let newComment = $state("");
let showComments = $state(true);