SymphonyElectron/js/aboutApp/renderer.js
Kiran Niranjan 3be2986c7e Electron-401 (fixes crash reporter) (#334)
- fix crash reporter
- fix typo
- Add support to generate crash report
- Add logic to store globally and return
- PR review fixes
- Add logic to validate file mime type
2018-04-11 18:43:59 +05:30

33 lines
1013 B
JavaScript

'use strict';
const { remote, ipcRenderer, crashReporter } = require('electron');
renderDom();
/**
* 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}`
});
}
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);
}
});