Skip to content

Commit b75cbd1

Browse files
trangdoan982claude
andcommitted
ENG-2084 Reset applying flag only on the failure path
The success path calls onClose() and unmounts, so the finally block was setting state on an unmounted component. Harmless — React removed that warning in 18.0 and it is a silent no-op — but the ordering read as if the reset mattered after close. Only the catch stays mounted, so only it resets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent f8d4c97 commit b75cbd1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/obsidian/src/components/ImportSpecsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const ImportPreviewSelection = ({
8787
} catch (error) {
8888
const message = error instanceof Error ? error.message : String(error);
8989
new Notice(`Failed to import schema: ${message}`, 6000);
90-
} finally {
90+
// Only the failure path stays mounted; the success path unmounted at onClose()
9191
setIsApplyingImport(false);
9292
}
9393
};

0 commit comments

Comments
 (0)