From 4c748a100753b99ce90409fea96f2ec408481621 Mon Sep 17 00:00:00 2001 From: bruno Date: Tue, 6 Feb 2024 16:37:23 +0100 Subject: [PATCH] fix js --- assets/script.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/assets/script.js b/assets/script.js index e61c1e3..54181fc 100644 --- a/assets/script.js +++ b/assets/script.js @@ -91,11 +91,10 @@ async function doPageAction(requestData, wantsReturn = false) { throw new Error(`HTTP error! Status: ${response.status}`); } + const data = await response.json(); + handlePageResponse(data); if (wantsReturn) { - return await response.json(); - } else { - const data = await response.json(); - handlePageResponse(data); + return data; } } catch (error) { console.error('Error:', error);