Small tweak to setupApp callback

This commit is contained in:
Davide Passoni
2024-04-16 17:28:52 +02:00
parent 627c19e550
commit 6296bdc2d8
2 changed files with 7 additions and 5 deletions

View File

@@ -2,8 +2,10 @@
var app: OlympusApp;
export function setupApp() {
app = new OlympusApp();
app.start();
if (app === undefined) {
app = new OlympusApp();
app.start();
}
}
export function getApp() {
@@ -477,7 +479,7 @@ export class OlympusApp {
}
/* Temporary */
this.getServerManager().setCredentials("admin", "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b");
this.getServerManager().setCredentials("admin", "4b8823ed9e5c2392ab4a791913bb8ce41956ea32e308b760eefb97536746dd33");
this.getServerManager().startUpdate();
/* Reload the page, used to mimic a restart of the app */

View File

@@ -49,7 +49,7 @@ export function UI() {
}
return (
<div className="absolute top-0 left-0 h-screen w-screen font-sans overflow-hidden">
<div className="absolute top-0 left-0 h-screen w-screen font-sans overflow-hidden" onLoad={setupApp}>
<StateProvider value={{
mainMenuVisible: mainMenuVisible,
spawnMenuVisible: spawnMenuVisible,
@@ -73,7 +73,7 @@ export function UI() {
toggleDrawingMenuVisible: () => { hideAllMenus(); setDrawingMenuVisible(!drawingMenuVisible) },
}
}>
<div className='absolute top-0 left-0 h-full w-full flex flex-col' onLoad={setupApp}>
<div className='absolute top-0 left-0 h-full w-full flex flex-col'>
<Header />
<div className='flex h-full'>
<SideBar />