diff --git a/src/display/display_utils.js b/src/display/display_utils.js index e7e52c6c1..98c8e4714 100644 --- a/src/display/display_utils.js +++ b/src/display/display_utils.js @@ -435,21 +435,15 @@ async function fetchData(url, type = "text") { return; } if (request.status === 200 || request.status === 0) { - let data; switch (type) { case "arraybuffer": case "blob": case "json": - data = request.response; - break; - default: - data = request.responseText; - break; - } - if (data) { - resolve(data); - return; + resolve(request.response); + return; } + resolve(request.responseText); + return; } reject(new Error(request.statusText)); };