chore: community page fixes.

This commit is contained in:
Rotimi Best
2026-05-21 16:38:35 +01:00
parent 9435490c43
commit 6f84002fa5
13 changed files with 28 additions and 12 deletions
@@ -31,7 +31,7 @@
question?: CommunityQuestionSuccess['data'] | null;
}
let { question, backHref }: Props = $props();
let { slug, question, backHref }: Props = $props();
let commentEditor: TiptapEditor | undefined = $state();
let isValidAnswer = false; // V2 allow admin mark an answer as accepted
@@ -54,6 +54,14 @@
}
});
let isQuestionFetched = $state(false);
$effect(() => {
if (question || !slug || isQuestionFetched) return;
communityApi.fetchCommunityQuestion({ slug });
isQuestionFetched = true;
});
$effect(() => {
if (!$profile.id || !$currentOrg.id) return;
@@ -36,6 +36,14 @@
}
});
let isQuestionsFetched = $state(false);
$effect(() => {
if (questions || !$currentOrg.id || isQuestionsFetched) return;
communityApi.fetchCommunityQuestions({ orgId: $currentOrg.id });
isQuestionsFetched = true;
});
let isCoursesFetched = $state(false);
$effect(() => {
if (!$profile.id || !$currentOrg.id || isCoursesFetched) return;