From 41d8dbad5de499a8f7b54156bb17ebd0099df924 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Wed, 12 Jul 2023 11:25:58 +0200 Subject: [PATCH] simplify decompression and decoding --- app/static/js/cqi/api/client.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/static/js/cqi/api/client.js b/app/static/js/cqi/api/client.js index 9b84336d..92e423a8 100644 --- a/app/static/js/cqi/api/client.js +++ b/app/static/js/cqi/api/client.js @@ -631,9 +631,7 @@ cqi.api.APIClient = class APIClient { const fn_name = 'ext_corpus_static_data'; const fn_args = {corpus: corpus}; let compressedEncodedData = await this.#request(fn_name, fn_args); - let encodedData = pako.inflate(compressedEncodedData); - let textDecoder = new TextDecoder(); - let data = textDecoder.decode(encodedData); + let data = pako.inflate(compressedEncodedData, {to: 'string'}); return JSON.parse(data); }