From e84da3089a70914bb33556a91f7b55b94153ea82 Mon Sep 17 00:00:00 2001 From: "ShengYan, Zhang" Date: Wed, 24 May 2023 14:44:06 +0800 Subject: [PATCH] fix state loss after user switches from steps --- app/components/exporter.tsx | 121 +++++++++++++++++------------------- 1 file changed, 57 insertions(+), 64 deletions(-) diff --git a/app/components/exporter.tsx b/app/components/exporter.tsx index f79e8490..a9a1071d 100644 --- a/app/components/exporter.tsx +++ b/app/components/exporter.tsx @@ -152,71 +152,64 @@ export function MessageExporter() { index={currentStepIndex} onStepChange={setCurrentStepIndex} /> - -
- {currentStep.value === "select" && ( - <> - - - - - - { - updateExportConfig( - (config) => - (config.includeContext = e.currentTarget.checked), - ); - }} - > - - - - - )} - - {currentStep.value === "preview" && ( - <> - {exportConfig.format === "text" ? ( - - ) : ( - - )} - - )} +
+ + + + + + { + updateExportConfig( + (config) => (config.includeContext = e.currentTarget.checked), + ); + }} + > + + +
+ {currentStep.value === "preview" && ( +
+ {exportConfig.format === "text" ? ( + + ) : ( + + )} +
+ )} ); }