We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f743d6e commit 458cc5eCopy full SHA for 458cc5e
1 file changed
packages/imagekit-editor-dev/src/ImageKitEditor.tsx
@@ -148,7 +148,13 @@ function ImageKitEditorImpl<M extends RequiredMetadata>(
148
}, [resolvedProvider])
149
150
const handleOnClose = () => {
151
- const dirty = transformations.length > 0
+ // `dirty` should represent *unsynced* changes (host uses it to decide
152
+ // whether to show a close confirmation).
153
+ const state = useEditorStore.getState()
154
+ const hasChanges = !state.isPristine
155
+ const dirty = resolvedProvider
156
+ ? hasChanges && state.syncStatus !== "saved"
157
+ : hasChanges
158
props.onClose({ dirty, destroy })
159
}
160
0 commit comments