From 1e55c058b9ef59a92b47611ac3560b85d8705f97 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Wed, 14 Aug 2024 20:26:40 -0400 Subject: [PATCH] 6 --- src/assets/hestia.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/assets/hestia.js b/src/assets/hestia.js index c3494d2..0c08b12 100644 --- a/src/assets/hestia.js +++ b/src/assets/hestia.js @@ -1,22 +1,22 @@ import { Communicator,State } from './HestiaClasses.js'; window.onload = async function() { - const config = await fetch('/assets/config.json') + await fetch('/assets/config.json') .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); - } + + return response.json(); // Parse the JSON data from the response }) .then(data => { - console.log(data); // Use the JSON data here - return data; + const config = data; + console.log(config); + const psState = new State(config); + refreshState(window.document, psState); }) .catch(error => { console.error('There was a problem with the fetch operation:', error); }); - console.log(config); - const psState = new State(config); - refreshState(window.document, psState); }; function refreshState(doc, state) {