SymphonyElectron/js/aboutApp/renderer.js

33 lines
1013 B
JavaScript
Raw Normal View History

'use strict';
const { remote, ipcRenderer, crashReporter } = require('electron');
renderDom();
/**
2017-09-26 11:04:25 -05:00
* Method that renders application data
*/
function renderDom() {
document.addEventListener('DOMContentLoaded', function () {
const applicationName = remote.app.getName() || 'Symphony';
let appName = document.getElementById('app-name');
let copyright = document.getElementById('copyright');
appName.innerHTML = applicationName;
copyright.innerHTML = `Copyright © ${new Date().getFullYear()} ${applicationName}`
});
2017-09-26 11:04:25 -05:00
}
ipcRenderer.on('buildNumber', (event, buildNumber) => {
let versionText = document.getElementById('version');
const version = remote.app.getVersion();
if (versionText) {
versionText.innerHTML = version ? `Version ${version} (${version}.${buildNumber})` : 'N/A';
}
});
ipcRenderer.on('register-crash-reporter', (event, arg) => {
if (arg && typeof arg === 'object') {
crashReporter.start(arg);
}
});