Skip to content

Commit 609a8a5

Browse files
committed
fix hasChanges logic
1 parent b46f760 commit 609a8a5

File tree

1 file changed

+4
-9
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/components

1 file changed

+4
-9
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/components/api-info-modal.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,14 @@ export function ApiInfoModal({ open, onOpenChange, workflowId }: ApiInfoModalPro
9898
const hasChanges = useMemo(() => {
9999
if (description !== initialDescriptionRef.current) return true
100100

101-
const currentKeys = Object.keys(paramDescriptions)
102-
const initialKeys = Object.keys(initialParamDescriptionsRef.current)
103-
104-
if (currentKeys.length !== initialKeys.length) return true
105-
106-
for (const key of currentKeys) {
107-
const currentValue = paramDescriptions[key] || ''
108-
const initialValue = initialParamDescriptionsRef.current[key] || ''
101+
for (const field of inputFormat) {
102+
const currentValue = (paramDescriptions[field.name] || '').trim()
103+
const initialValue = (initialParamDescriptionsRef.current[field.name] || '').trim()
109104
if (currentValue !== initialValue) return true
110105
}
111106

112107
return false
113-
}, [description, paramDescriptions])
108+
}, [description, paramDescriptions, inputFormat])
114109

115110
const handleParamDescriptionChange = (fieldName: string, value: string) => {
116111
setParamDescriptions((prev) => ({

0 commit comments

Comments
 (0)