mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Electron-142 - Included build version in the about app section
This commit is contained in:
committed by
Kiran Niranjan
parent
eee6fe8bc9
commit
564950ec92
@@ -6,6 +6,7 @@ const path = require('path');
|
||||
const fs = require('fs');
|
||||
const log = require('../log.js');
|
||||
const logLevels = require('../enums/logLevels.js');
|
||||
const buildVersion = require('../../package.json').buildVersion;
|
||||
|
||||
let aboutWindow;
|
||||
|
||||
@@ -78,6 +79,10 @@ function openAboutWindow(windowName) {
|
||||
aboutWindow.show();
|
||||
});
|
||||
|
||||
aboutWindow.webContents.on('did-finish-load', () => {
|
||||
aboutWindow.webContents.send('buildVersion', buildVersion || '0');
|
||||
});
|
||||
|
||||
aboutWindow.on('close', () => {
|
||||
destroyWindow();
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
const { remote } = require('electron');
|
||||
const { remote, ipcRenderer } = require('electron');
|
||||
|
||||
renderDom();
|
||||
|
||||
@@ -9,13 +9,19 @@ renderDom();
|
||||
function renderDom() {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const applicationName = remote.app.getName() || 'Symphony';
|
||||
const version = remote.app.getVersion();
|
||||
let appName = document.getElementById('app-name');
|
||||
let versionText = document.getElementById('version');
|
||||
let copyright = document.getElementById('copyright');
|
||||
|
||||
appName.innerHTML = applicationName;
|
||||
versionText.innerHTML = version ? `Version ${version} (${version})` : null;
|
||||
copyright.innerHTML = `Copyright © ${new Date().getFullYear()} ${applicationName}`
|
||||
});
|
||||
}
|
||||
|
||||
ipcRenderer.on('buildVersion', (event, buildVersion) => {
|
||||
let versionText = document.getElementById('version');
|
||||
const version = remote.app.getVersion();
|
||||
|
||||
if (versionText) {
|
||||
versionText.innerHTML = version ? `Version ${version} (${version}.${buildVersion})` : null;
|
||||
}
|
||||
});
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "Symphony",
|
||||
"productName": "Symphony",
|
||||
"version": "2.0.0",
|
||||
"buildVersion": "",
|
||||
"description": "Symphony desktop app (Foundation ODP)",
|
||||
"author": "Symphony",
|
||||
"main": "js/main.js",
|
||||
|
||||
Reference in New Issue
Block a user