diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyDataView/StudyFileView.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyDataView/StudyFileView.tsx index ddba819ae2..1a35c18add 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyDataView/StudyFileView.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyDataView/StudyFileView.tsx @@ -40,7 +40,7 @@ function StudyFileView(props: PropTypes) { setLoaded(false); try { const res = await getStudyData(study, url); - if (typeof res === "object") { + if (Array.isArray(res)) { setData(res.join("\n")); } else { setData(res); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyTreeView/utils.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyTreeView/utils.ts index ea0b7d6cb5..ec0d7b154e 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyTreeView/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/DebugView/StudyTreeView/utils.ts @@ -15,10 +15,15 @@ export const getStudyParams = ( path: string, itemkey: string ): StudyParams | undefined => { - if (typeof data !== "object") { + console.log({ + data, + path, + itemkey, + }); + if (typeof data === "string") { const tmp = data.split("://"); if (tmp && tmp.length > 0) { - if (tmp[0] === "json") { + if (tmp[0] === "json" || tmp[1].endsWith(".json")) { return { type: "json", data: `${path}/${itemkey}`,