Skip to content

Commit 1b96c33

Browse files
committed
fix: json editor
1 parent 7129ae9 commit 1b96c33

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

src/app/app/configs/[name]/page.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,7 @@ export default function ConfigByNamePage() {
3333

3434
const defaultValue = useMemo(() => {
3535
if (!config) return '';
36-
try {
37-
return JSON.stringify(
38-
typeof config.config.value === 'string'
39-
? JSON.parse(config.config.value)
40-
: config.config.value,
41-
null,
42-
2,
43-
);
44-
} catch {
45-
// if parsing fails, still show as string
46-
return typeof config.config.value === 'string'
47-
? config.config.value
48-
: String(config.config.value);
49-
}
36+
return JSON.stringify(config.config.value, null, 2);
5037
}, [config]);
5138

5239
if (!config) {

0 commit comments

Comments
 (0)