fix: replace reset useEffects with key prop for step component remount
The reset useEffects in StepOrientation/Deskew/Dewarp/Crop were clearing
orientationResult when sessionId changed (e.g. during handleOrientationComplete),
causing the right side of ImageCompareView to show nothing. Using key={sessionId}
on the step components instead forces React to remount with fresh state when
switching sessions, without interfering with the upload/orientation flow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,14 +22,6 @@ export function StepDeskew({ sessionId, onNext }: StepDeskewProps) {
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [hasAutoRun, setHasAutoRun] = useState(false)
|
||||
|
||||
// Reset state when sessionId changes (e.g. switching sub-sessions)
|
||||
useEffect(() => {
|
||||
setSession(null)
|
||||
setDeskewResult(null)
|
||||
setHasAutoRun(false)
|
||||
setError(null)
|
||||
}, [sessionId])
|
||||
|
||||
// Load session and auto-trigger deskew
|
||||
useEffect(() => {
|
||||
if (!sessionId || session) return
|
||||
|
||||
Reference in New Issue
Block a user