From 2103db3ebd03fdc33f9eaa661c34d1d9d871dcf0 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 31 Jan 2024 18:15:23 +0300 Subject: [PATCH] load-comments-fix --- src/components/Views/Author/Author.tsx | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index 2742637b..b8813adb 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -144,22 +144,16 @@ export const AuthorView = (props: Props) => { } const [commented, setCommented] = createSignal([]) - createEffect( - on( - author, - (a: Author) => { - if (getPage().route === 'authorComments') { - console.debug('[components.Author] routed to comments') - try { - if (a) fetchComments(a) - } catch (error) { - console.error('[components.Author] fetch error', error) - } - } - }, - { defer: true }, - ), - ) + createEffect(() => { + if (author() && getPage().route === 'authorComments') { + console.debug('[components.Author] routed to comments') + try { + fetchComments(author()) + } catch (error) { + console.error('[components.Author] fetch error', error) + } + } + }) const ogImage = createMemo(() => author()?.pic