Get electron and application versions dynamically.
This commit is contained in:
parent
e7482bc6cb
commit
ac7a137f4e
|
@ -1,11 +1,11 @@
|
|||
const angApp = angular.module('app', [])
|
||||
angApp.constant('AppInfo', {
|
||||
APP_NAME: 'Converse Desktop',
|
||||
APP_VERSION: 'v0.1.0',
|
||||
APP_VERSION: await api.getApplicationVersion(),
|
||||
APP_HOME: 'https://github.com/conversejs/converse-desktop',
|
||||
APP_RELEASES_CHECK_URL: 'https://api.github.com/repos/conversejs/converse-desktop/releases',
|
||||
APP_RELEASES_URL: 'https://github.com/conversejs/converse-desktop/releases',
|
||||
ELECTRON_VERSION: '13.6.6'
|
||||
ELECTRON_VERSION: await api.getElectronVersion()
|
||||
});
|
||||
|
||||
export default angApp;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
class="chimeverse-branding__img" />
|
||||
</div>
|
||||
<div class="about-card__description">
|
||||
<h3 class="about__title">About {{appInfo.APP_NAME}} {{appInfo.APP_VERSION}}</h3>
|
||||
<h3 class="about__title">About {{appInfo.APP_NAME}} v{{appInfo.APP_VERSION}}</h3>
|
||||
<div class="about__description">Jabber/XMPP client based on Converse.js and Electron</div>
|
||||
<div> </div>
|
||||
<div class="about__converse-version">
|
||||
|
|
8
main.js
8
main.js
|
@ -141,6 +141,14 @@ function createWindow() {
|
|||
return mainWindow.reload();
|
||||
})
|
||||
|
||||
ipcMain.handle('getApplicationVersion', () => {
|
||||
return app.getVersion();
|
||||
});
|
||||
|
||||
ipcMain.handle('getElectronVersion', () => {
|
||||
return process.versions.electron;
|
||||
});
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
|
|
|
@ -15,6 +15,14 @@ contextBridge.exposeInMainWorld('api', {
|
|||
ipcRenderer.send('reload')
|
||||
},
|
||||
|
||||
getApplicationVersion() {
|
||||
return ipcRenderer.invoke('getApplicationVersion');
|
||||
},
|
||||
|
||||
getElectronVersion() {
|
||||
return ipcRenderer.invoke('getElectronVersion');
|
||||
},
|
||||
|
||||
electronSettings: {
|
||||
hasSync(setting) {
|
||||
return ipcRenderer.sendSync('electron-settings', 'hasSync', setting)
|
||||
|
|
Loading…
Reference in New Issue