From 23d959bf6471641c69e866c69ae70096691ed729 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 2 May 2024 17:26:41 +0100 Subject: [PATCH] chore: Clarify usage of window fields in index.js /puter/src/index.js 58:15 error 'loadScript' is not defined no-undef 59:15 error 'loadScript' is not defined no-undef 65:13 error 'gui_env' is not defined no-undef 66:15 error 'loadScript' is not defined no-undef 68:15 error 'loadCSS' is not defined no-undef 69:15 error 'loadScript' is not defined no-undef 73:5 error 'initgui' is not defined no-undef --- src/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 0a9404721..2dc7defd9 100644 --- a/src/index.js +++ b/src/index.js @@ -55,22 +55,22 @@ window.gui = async function(options){ // DEV: Load the initgui.js file if we are in development mode if(!window.gui_env || window.gui_env === "dev"){ - await loadScript('/sdk/puter.dev.js'); - await loadScript('/initgui.js', {isModule: true}); + await window.loadScript('/sdk/puter.dev.js'); + await window.loadScript('/initgui.js', {isModule: true}); } // PROD: load the minified bundles if we are in production mode // note: the order of the bundles is important // note: Build script will prepend `window.gui_env="prod"` to the top of the file - else if(gui_env === "prod"){ - await loadScript('https://js.puter.com/v2/'); + else if(window.gui_env === "prod"){ + await window.loadScript('https://js.puter.com/v2/'); // Load the minified bundles - await loadCSS('/dist/bundle.min.css'); - await loadScript('/dist/bundle.min.js'); + await window.loadCSS('/dist/bundle.min.css'); + await window.loadScript('/dist/bundle.min.js'); } // 🚀 Launch the GUI 🚀 - initgui(); + window.initgui(); } /**