diff --git a/electron/mainWindow.ts b/electron/mainWindow.ts index d361521..0b71d09 100644 --- a/electron/mainWindow.ts +++ b/electron/mainWindow.ts @@ -38,25 +38,25 @@ class Main { this.configDev = new ConfigureDev(this.settingsDev); app.on("ready", async () => { - // let loading = new BrowserWindow({ - // show: false, - // frame: false, - // width: 300, - // height: 300, - // transparent: true, - // }); - - this.window = await this.createWindow(); - this.onEvent.emit("window-created"); - - // loading.once("show", async () => { - // this.window = await this.createWindow(); - // this.onEvent.emit("window-created"); - // loading.hide(); - // loading.close(); - // }); - // loading.loadURL(path.join(__dirname, "www", "loading.html")); - // loading.show(); + let loading = new BrowserWindow({ + show: false, + frame: false, + width: 300, + height: 300, + transparent: true, + }); + + // this.window = await this.createWindow(); + // this.onEvent.emit("window-created"); + + loading.once("show", async () => { + this.window = await this.createWindow(); + this.onEvent.emit("window-created"); + loading.hide(); + loading.close(); + }); + loading.loadURL(path.join(__dirname, "www", "loading.html")); + loading.show(); }); app.on("window-all-closed", this.onWindowAllClosed); @@ -81,7 +81,7 @@ class Main { try { await window.loadURL("http://localhost:5173/"); } catch (error) { - console.log(`ERROR: window.loadURL("http://localhost:3000/");`); + console.log(`ERROR: window.loadURL("http://localhost:5173/");`); console.log(error); } } else if (this.configDev.isElectronServe()) { diff --git a/package-lock.json b/package-lock.json index 9a490f2..39c3a2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "memento-sveltekit-electron-typescript", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "memento-sveltekit-electron-typescript", - "version": "0.2.0", + "version": "0.2.1", "license": "MIT", "dependencies": { "@el3um4s/ipc-for-electron": "^1.0.7", diff --git a/package.json b/package.json index 6b187aa..cff980e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Memento: how to use Svelte with Electron and TypeScript", "author": "Samuele de Tomasi ", "license": "MIT", - "version": "0.2.0", + "version": "0.2.1", "main": "dist/index.js", "scripts": { "nodemon": "nodemon", diff --git a/svelte/static/loading.html b/svelte/static/loading.html new file mode 100644 index 0000000..561438d --- /dev/null +++ b/svelte/static/loading.html @@ -0,0 +1,18 @@ + + + + + + + + + Loading + + +
+
+ +
+
+ + \ No newline at end of file diff --git a/svelte/static/loading.png b/svelte/static/loading.png new file mode 100644 index 0000000..7f2b317 Binary files /dev/null and b/svelte/static/loading.png differ