fix(dashboard): call route modal onClose only on route change (#12383)

This commit is contained in:
Frane Polić authored and GitHub committed 2025-05-11 19:52:12 +02:00
1 parent 9d4bc81d0f
commit 3fb4d5beb0
2 files changed
+11 -6

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/dashboard": patch
---
fix(dashboard): call route modal onClose only on route change
@@ -35,22 +35,22 @@ export const RouteModalForm = <TFieldValues extends FieldValues = any>({
const isSearchChanged = currentLocation.search !== nextLocation.search
if (blockSearch) {
const ret = isDirty && (isPathChanged || isSearchChanged)
const shouldBlock = isDirty && (isPathChanged || isSearchChanged)
if (!ret) {
if (isPathChanged) {
onClose?.(isSubmitSuccessful)
}
return ret
return shouldBlock
}
const ret = isDirty && isPathChanged
const shouldBlock = isDirty && isPathChanged
if (!ret) {
if (isPathChanged) {
onClose?.(isSubmitSuccessful)
}
return ret
return shouldBlock
})
const handleCancel = () => {