diff --git a/main.js b/main.js index afe90f4..c690b5e 100644 --- a/main.js +++ b/main.js @@ -16,6 +16,7 @@ const defaultDownloadPath = path.join(os.homedir(), "Downloads", "Freedom Loader app.setAppUserModelId("com.masteracnolo.freedomloader"); // pour notifications Windows app.disableHardwareAcceleration(); +ipcMain.handle("version", () => config.version); // Gestion single instance const gotLock = app.requestSingleInstanceLock(); diff --git a/preload.js b/preload.js index 4e5eb5f..150ec42 100644 --- a/preload.js +++ b/preload.js @@ -5,6 +5,7 @@ contextBridge.exposeInMainWorld("electronAPI", { selectDownloadFolder: () => ipcRenderer.invoke("select-download-folder"), setProgress: (percent) => ipcRenderer.send("set-progress", percent), getFeatures: () => ipcRenderer.invoke("features"), + getVersion: () => ipcRenderer.invoke("version"), getValidatedDownloadPath: (path) => ipcRenderer.invoke("validate-download-path", path) }); diff --git a/public/index.html b/public/index.html index 3f8e077..ebafd10 100644 --- a/public/index.html +++ b/public/index.html @@ -95,10 +95,11 @@
- v1.3.1 + + diff --git a/public/script/appVersion.js b/public/script/appVersion.js new file mode 100644 index 0000000..ad9aaa0 --- /dev/null +++ b/public/script/appVersion.js @@ -0,0 +1,6 @@ +async function versionLabel(){ + const appVersion = await window.electronAPI.getVersion(); + document.getElementById("version-badge").textContent = `v${appVersion}`; +}; + +versionLabel(); \ No newline at end of file