Skip to content

Commit

Permalink
Merge pull request #802 from Pax1601/manager-wizard
Browse files Browse the repository at this point in the history
Version is now checked on manager startup
  • Loading branch information
Pax1601 authored Jan 4, 2024
2 parents 1ab8e9a + 33ce537 commit 2232a11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 9 additions & 6 deletions manager/javascripts/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AdmZip = require("adm-zip");
const { Octokit } = require('octokit');
const { logger } = require("./filesystem")

const VERSION = "v2.0.0";
const VERSION = "{{OLYMPUS_VERSION_NUMBER}}";
logger.log(`Running in ${__dirname}`);
function checkVersion() {
/* Check if we are running the latest version */
Expand Down Expand Up @@ -221,7 +221,8 @@ const ipc = {
/* From main to render. */
'receive': [
'event:maximized',
'event:unmaximized'
'event:unmaximized',
'check-version'
],
/* From render to main and back again. */
'sendReceive': []
Expand Down Expand Up @@ -261,9 +262,6 @@ const manager = new Manager();

/* On content loaded */
window.addEventListener('DOMContentLoaded', async () => {
/* Check if a new version is available */
checkVersion();

/* Compute the height of the content page */
computePagesHeight();
document.getElementById("loader").classList.remove("hide");
Expand Down Expand Up @@ -295,4 +293,9 @@ function computePagesHeight() {
for (let i = 0; i < pages.length; i++) {
pages[i].style.height = (window.innerHeight - (titleBar.clientHeight + header.clientHeight)) + "px";
}
}
}

ipcRenderer.on("check-version", () => {
/* Check if a new version is available */
checkVersion();
})
1 change: 1 addition & 0 deletions manager/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function createWindow() {

electronApp.on('ready', () => {
window = createWindow();
window.webContents.send('check-version')
});

electronApp.on('window-all-closed', () => {
Expand Down

0 comments on commit 2232a11

Please sign in to comment.