change(ui): fix for network tabs?

This commit is contained in:
nick-delirium 2023-02-22 10:15:42 +01:00
parent 3210d10a0b
commit a975ef5ffc

View file

@ -22,7 +22,7 @@ function parseRequestResponse(
setStringBody('');
return;
}
let json = JSON.parse(r)
const json = JSON.parse(r)
const hs = json.headers
const bd = json.body as string
@ -35,11 +35,8 @@ function parseRequestResponse(
setJSONBody(null)
setStringBody('')
}
if (typeof bd !== 'string') {
throw new Error(`body is not a string`)
}
try {
let jBody = JSON.parse(bd)
const jBody = JSON.parse(bd)
if (typeof jBody === "object" && jBody != null) {
setJSONBody(jBody)
} else {