Introduce library for notifications on downlevel windows (#1812)

This commit is contained in:
Scott Nonnenberg 2017-11-22 13:50:52 -08:00 committed by GitHub
parent be2d4535a8
commit 16ad94148a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 7 deletions

View file

@ -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,
}
})
}