chore: community page fixes.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user