This commit is contained in:
AykutSarac 2025-01-13 23:31:10 +03:00
parent 8ecd67baf6
commit 5a02cb8809
No known key found for this signature in database
2 changed files with 17 additions and 19 deletions

View File

@ -10,22 +10,20 @@ export const TreeView = () => {
const json = useJson(state => state.json);
return (
<>
<JSONTree
hideRoot
data={JSON.parse(json)}
valueRenderer={(valueAsString, value) => <Value {...{ valueAsString, value }} />}
labelRenderer={(keyPath, nodeType) => <Label {...{ keyPath, nodeType }} />}
theme={{
extend: {
overflow: "scroll",
height: "100%",
scheme: "monokai",
author: "wimer hazenberg (http://www.monokai.nl)",
base00: theme.GRID_BG_COLOR,
},
}}
/>
</>
<JSONTree
hideRoot
data={JSON.parse(json)}
valueRenderer={(valueAsString, value) => <Value {...{ valueAsString, value }} />}
labelRenderer={(keyPath, nodeType) => <Label {...{ keyPath, nodeType }} />}
theme={{
extend: {
overflow: "scroll",
height: "100%",
scheme: "monokai",
author: "wimer hazenberg (http://www.monokai.nl)",
base00: theme.GRID_BG_COLOR,
},
}}
/>
);
};

View File

@ -178,8 +178,8 @@ const useFile = create<FileStates & JsonActions>()((set, get) => ({
}
},
checkEditorSession: (url, widget) => {
if (url && typeof url === "string") {
if (isURL(url)) return get().fetchUrl(url);
if (url && typeof url === "string" && isURL(url)) {
return get().fetchUrl(url);
}
let contents = defaultJson;