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);