Skip to content

Commit 7b9b01c

Browse files
authored
fix(frontend): prevent flash of empty seed opinion page during conversation creation (#410)
When creating a conversation with seed opinions, the page briefly flashed showing the seed opinion form without any opinions before navigating to the final conversation page. The issue was caused by clearing the conversation draft (via createEmptyDraft) before router navigation completed. Since conversationDraft is a reactive Pinia store, clearing it immediately triggered a re-render with empty seed opinions, creating a visible flash of the empty state. Changes: - Move createEmptyDraft() call to after router.replace() - This ensures the component keeps its seed opinion data visible during navigation - The component unmounts with data intact, preventing the empty state flash This provides a smooth transition from the review page to the conversation page without intermediate UI flashes.
1 parent c567ca9 commit 7b9b01c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • services/agora/src/pages/conversation/new/review

services/agora/src/pages/conversation/new/review/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,6 @@ async function onSubmit() {
336336
});
337337
338338
if (response.status == "success") {
339-
conversationDraft.value = createEmptyDraft();
340-
341339
await loadPostData();
342340
343341
// Set navigation context to indicate user came from conversation creation
@@ -348,6 +346,9 @@ async function onSubmit() {
348346
params: { postSlugId: response.data.conversationSlugId },
349347
});
350348
349+
// Clear draft after navigation to prevent re-render with empty data
350+
conversationDraft.value = createEmptyDraft();
351+
351352
// Don't stop loading - let component unmount with loading state active
352353
} else {
353354
isSubmitButtonLoading.value = false;

0 commit comments

Comments
 (0)