Procházet zdrojové kódy

fix decoding imported data from backend (#722)

David Luzar před 5 roky
rodič
revize
3b20e6e2b8
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  1. 1 2
      src/scene/data.ts

+ 1 - 2
src/scene/data.ts

@@ -252,8 +252,7 @@ export async function importFromBackend(
         buffer,
       );
       // We need to convert the decrypted array buffer to a string
-      const string = String.fromCharCode.apply(
-        null,
+      const string = new window.TextDecoder("utf-8").decode(
         new Uint8Array(decrypted) as any,
       );
       data = JSON.parse(string);