Introduce library for notifications on downlevel windows (#1812)
This commit is contained in:
parent
be2d4535a8
commit
16ad94148a
5 changed files with 54 additions and 7 deletions
9
main.js
9
main.js
|
@ -4,6 +4,7 @@ const os = require('os');
|
|||
|
||||
const _ = require('lodash');
|
||||
const electron = require('electron');
|
||||
const semver = require('semver');
|
||||
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
const app = electron.app;
|
||||
|
@ -63,6 +64,13 @@ const loadLocale = require('./app/locale').load;
|
|||
|
||||
let locale;
|
||||
|
||||
|
||||
const WINDOWS_8 = '8.0.0';
|
||||
const osRelease = os.release();
|
||||
const polyfillNotifications =
|
||||
os.platform() === 'win32' && semver.lt(osRelease, WINDOWS_8);
|
||||
console.log('OS Release:', osRelease, '- notifications polyfill?', polyfillNotifications);
|
||||
|
||||
function prepareURL(pathSegments) {
|
||||
return url.format({
|
||||
pathname: path.join.apply(null, pathSegments),
|
||||
|
@ -80,6 +88,7 @@ function prepareURL(pathSegments) {
|
|||
node_version: process.versions.node,
|
||||
hostname: os.hostname(),
|
||||
appInstance: process.env.NODE_APP_INSTANCE,
|
||||
polyfillNotifications: polyfillNotifications,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue