Skip to content

Commit d067079

Browse files
ivicacclaude
andcommitted
1652 client - Normalize selectValue initializer to always return a string
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1a8cb3b commit d067079

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

  • client/src/pages/platform/workflow-editor/components/properties/hooks

client/src/pages/platform/workflow-editor/components/properties/hooks/useProperty.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,23 @@ export const useProperty = ({
220220
parameterValue !== undefined ? parameterValue : property.defaultValue || ''
221221
);
222222
const [selectValue, setSelectValue] = useState(() => {
223-
if (parameterValue !== undefined && parameterValue !== null) {
224-
return typeof parameterValue === 'boolean' ? parameterValue.toString() : parameterValue;
223+
if (parameterValue !== undefined) {
224+
if (parameterValue === null) {
225+
return 'null';
226+
}
227+
228+
return String(parameterValue);
229+
}
230+
231+
if (property.defaultValue !== undefined) {
232+
if (property.defaultValue === null) {
233+
return 'null';
234+
}
235+
236+
return String(property.defaultValue);
225237
}
226238

227-
return property.defaultValue !== undefined ? property.defaultValue : 'null';
239+
return 'null';
228240
});
229241
const [showInputTypeSwitchButton, setShowInputTypeSwitchButton] = useState(
230242
!control && ((property.type !== 'STRING' && property.expressionEnabled) || false)

0 commit comments

Comments
 (0)