mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-29 13:48:46 +02:00
Reset results
This commit is contained in:
parent
a272850d54
commit
8349598da6
@ -34,6 +34,12 @@ const Automate = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
|||||||
automateOperation.resetResults();
|
automateOperation.resetResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If navigating to selection step, always clear results
|
||||||
|
if (data.step === AUTOMATION_STEPS.SELECTION) {
|
||||||
|
automateOperation.resetResults();
|
||||||
|
automateOperation.clearError();
|
||||||
|
}
|
||||||
|
|
||||||
// If navigating to run step with a different automation, reset results
|
// If navigating to run step with a different automation, reset results
|
||||||
if (data.step === AUTOMATION_STEPS.RUN && data.automation &&
|
if (data.step === AUTOMATION_STEPS.RUN && data.automation &&
|
||||||
stepData.automation && data.automation.id !== stepData.automation.id) {
|
stepData.automation && data.automation.id !== stepData.automation.id) {
|
||||||
@ -127,7 +133,12 @@ const Automate = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
|||||||
createStep(t('automate.selection.title', 'Automation Selection'), {
|
createStep(t('automate.selection.title', 'Automation Selection'), {
|
||||||
isVisible: true,
|
isVisible: true,
|
||||||
isCollapsed: currentStep !== AUTOMATION_STEPS.SELECTION,
|
isCollapsed: currentStep !== AUTOMATION_STEPS.SELECTION,
|
||||||
onCollapsedClick: () => setCurrentStep(AUTOMATION_STEPS.SELECTION)
|
onCollapsedClick: () => {
|
||||||
|
// Clear results when clicking back to selection
|
||||||
|
automateOperation.resetResults();
|
||||||
|
setCurrentStep(AUTOMATION_STEPS.SELECTION);
|
||||||
|
setStepData({ step: AUTOMATION_STEPS.SELECTION });
|
||||||
|
}
|
||||||
}, currentStep === AUTOMATION_STEPS.SELECTION ? renderCurrentStep() : null),
|
}, currentStep === AUTOMATION_STEPS.SELECTION ? renderCurrentStep() : null),
|
||||||
|
|
||||||
createStep(stepData.mode === AutomationMode.EDIT
|
createStep(stepData.mode === AutomationMode.EDIT
|
||||||
@ -158,7 +169,7 @@ const Automate = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
|||||||
},
|
},
|
||||||
steps: automationSteps,
|
steps: automationSteps,
|
||||||
review: {
|
review: {
|
||||||
isVisible: hasResults,
|
isVisible: hasResults && currentStep === AUTOMATION_STEPS.RUN,
|
||||||
operation: automateOperation,
|
operation: automateOperation,
|
||||||
title: t('automate.reviewTitle', 'Automation Results')
|
title: t('automate.reviewTitle', 'Automation Results')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user