You can open the index.html file in your browser while editing the UI. Ensuring the script will add the app to your phone.
You need to wait for the components to load before you can use them. You can listen for the componentsLoaded
message to know when the components are ready.
window.addEventListener("message", (e) => {
if (e.data !== "componentsLoaded") return
// Here you can access the components
})
We recommend using the Live Server extension for VS Code when developing the app. This automatically refreshes the UI; meaning that you won't have to ensure the script/refresh the html file each time you make changes to the UI.
To use, follow these steps:
- Install the extension
- Right click on the ui/index.html file, and click "Open with Live Server"
- Uncomment line 21 in client.lua
- Comment out line 22 in client.lua