Browse Source

Refactor comments, some more

imwald
Nuša Pukšič 3 months ago
parent
commit
21732304ee
  1. 11
      src/Twig/Components/Organisms/Comments.php

11
src/Twig/Components/Organisms/Comments.php

@ -58,7 +58,7 @@ final class Comments
} }
#[LiveAction] #[LiveAction]
public function loadComments(#[LiveArg] string $payload): array public function loadComments(#[LiveArg] string $payload): void
{ {
$data = json_decode($payload,true); $data = json_decode($payload,true);
@ -69,14 +69,7 @@ final class Comments
$this->parseZaps(); // your existing method – fills $zapAmounts & $zappers $this->parseZaps(); // your existing method – fills $zapAmounts & $zappers
$this->parseNostrLinks(); // your existing method – fills $commentLinks & $processedContent $this->parseNostrLinks(); // your existing method – fills $commentLinks & $processedContent
return [ $this->loading = false;
'list' => $this->list,
'authorsMetadata' => $this->authorsMetadata,
'zappers' => $this->zappers,
'zapAmounts' => $this->zapAmounts,
'commentLinks' => $this->commentLinks,
'loading' => false,
];
} }
/** /**

Loading…
Cancel
Save