mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 12:20:34 +00:00
optimize editor default value code (#4794)
This commit is contained in:
@@ -178,12 +178,11 @@ const JSONEditor = ({
|
||||
return '';
|
||||
}
|
||||
|
||||
try {
|
||||
if (typeof value === 'object') {
|
||||
return JSON.stringify(value, null, 2);
|
||||
} catch (error) {
|
||||
console.error('JSON stringify error:', error);
|
||||
return String(value) || '';
|
||||
}
|
||||
|
||||
return String(value);
|
||||
}, [value]);
|
||||
|
||||
const onBlur = useCallback(() => {
|
||||
|
Reference in New Issue
Block a user