From b0e55bda1357925866e3568b65bd23adcf04716c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Sun, 26 Oct 2025 20:30:31 +0100 Subject: [PATCH] Refactor comments, sigh --- src/Twig/Components/Organisms/Comments.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Twig/Components/Organisms/Comments.php b/src/Twig/Components/Organisms/Comments.php index fbb887b..88446dd 100644 --- a/src/Twig/Components/Organisms/Comments.php +++ b/src/Twig/Components/Organisms/Comments.php @@ -26,7 +26,7 @@ final class Comments #[LiveProp(writable: false)] public string $current; - // same fields you used before (the template will read from the payload) + #[LiveProp] public array $list = []; public array $commentLinks = []; public array $processedContent = []; @@ -60,11 +60,11 @@ final class Comments #[LiveAction] public function loadComments(#[LiveArg] string $payload): void { - $data = json_decode($payload,true); + $data = json_decode($payload); // If your handler doesn’t compute zaps/links yet, reuse your helpers here: - $this->list = $data['comments']; - $this->authorsMetadata = $data['profiles'] ?? []; + $this->list = $data->comments; + $this->authorsMetadata = $data->profiles ?? []; $this->parseZaps(); // your existing method – fills $zapAmounts & $zappers $this->parseNostrLinks(); // your existing method – fills $commentLinks & $processedContent