Skip to content

Commit

Permalink
fix blob to string
Browse files Browse the repository at this point in the history
  • Loading branch information
cracker0dks committed Jan 29, 2023
1 parent b4c4447 commit 2e9a01a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions web/js/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ var connectWs = function() {
}

ws.onmessage = async function (event) {
console.log("msg: "+event.data.toString())
let tempSt = event.data.toString();
if(typeof(tempSt) != "string") {
tempSt = await new Response(tempSt).text()
if(typeof(event.data) != "string") {
tempSt = await new Response(event.data).text()
}

console.log("msg: "+tempSt)
messageParts_a = tempSt.split("###");
var key = messageParts_a[0];
var value = messageParts_a[1];
Expand Down

0 comments on commit 2e9a01a

Please sign in to comment.