mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Feat: Add version badge controlled. Before we needed to write with the hand for the front. But now there is an IPC event that provide App Version from package.json
This commit is contained in:
1
main.js
1
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();
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
|
||||
@@ -95,10 +95,11 @@
|
||||
<div id="videoInfo" style="margin-top: 20px;"></div>
|
||||
</div>
|
||||
|
||||
<span id="version-badge" class="version-badge">v1.3.1</span>
|
||||
<span id="version-badge" class="version-badge"></span>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="script/custompath.js"></script>
|
||||
<script src="script/appVersion.js"></script>
|
||||
<script src="script/downloadstatus.js"></script>
|
||||
<script src="script/fetchinfo.js"></script>
|
||||
<script src="script/progressBar.js"></script>
|
||||
|
||||
6
public/script/appVersion.js
Normal file
6
public/script/appVersion.js
Normal file
@@ -0,0 +1,6 @@
|
||||
async function versionLabel(){
|
||||
const appVersion = await window.electronAPI.getVersion();
|
||||
document.getElementById("version-badge").textContent = `v${appVersion}`;
|
||||
};
|
||||
|
||||
versionLabel();
|
||||
Reference in New Issue
Block a user