Skip to content

Commit

Permalink
fix(ui-debug): issue to display json file in outputs (#1747)
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril authored Sep 30, 2023
1 parent 9347bbe commit 9d30463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export const getStudyParams = (
path: string,
itemkey: string
): StudyParams | undefined => {
if (typeof data !== "object") {
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}`,
Expand Down

0 comments on commit 9d30463

Please sign in to comment.