Skip to content

Commit

Permalink
v8.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sidneys committed Dec 10, 2018
1 parent 98d6a4e commit a5f0d37
Show file tree
Hide file tree
Showing 132 changed files with 5,819 additions and 7,450 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init:

install:
- cmd: echo 🔧 Setting up Node
- ps: Install-Product node 10.0.0
- ps: Install-Product node 11.0.0
- cmd: npm --global update npm
- cmd: npm --global install yarn

Expand Down
11 changes: 0 additions & 11 deletions .deblist

This file was deleted.

3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
indent_size = 4

[.eslintrc]
indent_size = 2

Expand Down
34 changes: 29 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@
"es6": true,
"node": true
},
"globals": {
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"globalReturn": true,
"impliedStrict": true,
"jsx": true
}
},
"root": true,
"rules": {
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
"camelcase": "off",
"comma-dangle": [
"error",
Expand All @@ -31,13 +45,16 @@
"key-spacing": [
"error",
{
"beforeColon": false,
"afterColon": true
"afterColon": true,
"beforeColon": false
}
],
"keyword-spacing": [
"error",
{}
{
"after": true,
"before": true
}
],
"linebreak-style": [
"error",
Expand All @@ -49,7 +66,13 @@
"no-multi-str": "error",
"no-trailing-spaces": "error",
"no-undef": "error",
"no-unused-vars": "error",
"no-unused-vars": [
"error",
{
"args": "none",
"vars": "local"
}
],
"no-use-before-define": [
"error",
{
Expand All @@ -61,6 +84,7 @@
"error",
"always"
],
"object-shorthand": "off",
"quotes": [
"error",
"single",
Expand Down
58 changes: 37 additions & 21 deletions .jsdoc.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
{
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc"]
"docdash": {
"static": false,
"sort": true
},
"markdown": {
"parser": "gfm",
"hardwrap": true
},
"opts": {
"destination": "./docs",
"encoding": "utf8",
"recurse": true,
"template": "./node_modules/docdash",
"verbose": true
},
"plugins": [
"plugins/markdown"
],
"tags": {
"allowUnknownTags": true
},
"templates": {
"cleverLinks": false,
"default": {
"outputSourceFiles": true,
"includeDate": false
},
"source": {
"include": ["app", "lib", "package.json", "README.md"],
"includePattern": ".js$",
"excludePattern": "(node_modules/|docs)"
},
"templates": {
"cleverLinks": false,
"monospaceLinks": true,
"useLongnameInNav": false,
"showInheritedInNav": true
},
"opts": {
"destination": "./docs/",
"encoding": "utf8",
"private": true,
"recurse": true,
"template": "./node_modules/minami"
}
"monospaceLinks": false
},
"recurseDepth": 10,
"source": {
"include": [
"./app",
"./bin"
],
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(node_modules/|docs)"
}
}
3 changes: 0 additions & 3 deletions .rpmlist

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ before_install:
- echo "🚦 Authorizing Build"
- echo "🔧 Setting up Node"
- curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | NVM_DIR="${HOME}"/.nvm sh
- source "${HOME}"/.nvm/nvm.sh && nvm install 10.0.0 && nvm use 10.0.0
- source "${HOME}"/.nvm/nvm.sh && nvm install 11.0.0 && nvm use 11.0.0
- npm --global update npm
- npm --global install yarn

Expand Down
21 changes: 21 additions & 0 deletions RELEASENOTES.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
{
"8.1.1": {
"🍾 features": [
"supports macOS Mojaves' system-wide dark mode (macOS)",
"adds Nintendo® notification sounds",
"adds VoiceOver notification sounds"
],
"💎 improvements": [
"normalizes all notification sounds according to EBU R128 (http://k.ylo.ph/2016/04/04/loudnorm.html)",
"addresses CPU and memory usage (https://github.com/sidneys/pb-for-desktop/issues/90)",
"various stability and performance improvements"
],
"🚨 fixes": [
"fixes Bad URI issue (https://github.com/sidneys/pb-for-desktop/issues/85)"
],
"👷 internals": [
"upgrades `electron` to `v3.0.10`",
"upgrades `node_modules`",
"upgrades `services`",
"upgrades `lib`"
]
},
"7.6.0": {
"💎 improvements": [
"Various stability and performance improvements"
Expand Down
82 changes: 56 additions & 26 deletions app/scripts/main/components/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const path = require('path')
* @constant
*/
const electron = require('electron')
const { app, BrowserWindow } = electron
const { app, BrowserWindow, systemPreferences } = electron

/**
* Modules
Expand Down Expand Up @@ -49,20 +49,44 @@ const globals = require(path.join(appRootPath['path'], 'app', 'scripts', 'main',

/**
* Hotfix
* Window Translucency
* @see {@link https://github.com/electron/electron/issues/2170}
*/
// app.disableHardwareAcceleration()

/**
* Hotfix
* EventEmitter Memory Leak
* @see {@link https://stackoverflow.com/questions/9768444/possible-eventemitter-memory-leak-detected}
*/
events.EventEmitter.defaultMaxListeners = Infinity

/**
* Hotfix (Windows)
* Hotfix
* Chrome 66 Autoplay Policy
* @see {@link https://github.com/electron/electron/issues/13525}
*/
app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required')

/**
* Hotfix
* Electron Security Warning
* @see {@link https://stackoverflow.com/questions/48854265/why-do-i-see-an-electron-security-warning-after-updating-my-electron-project-t}
*/
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'

/**
* Hotfix
* Notification API not working (Windows)
* @see {@link https://github.com/electron/electron/issues/10864}
*/
if (platformTools.isWindows) {
app.setAppUserModelId(global.manifest.appId)
}

/**
* Hotfix (Linux)
* Hotfix
* Missing App Indicator (Linux)
* @see {@link https://github.com/electron/electron/issues/10427}
*/
if (platformTools.isLinux) {
Expand All @@ -86,6 +110,31 @@ const snoozerService = require(path.join(appRootPath.path, 'app', 'scripts', 'ma
/* eslint-enable */


/**
* Ensure single instance
*/
if (!app.requestSingleInstanceLock()) {
logger.warn('Additional application instance detected:', app.getPath('exe'))
logger.warn('Exiting additional instance.')

app.quit()

return
}

/**
* @listens Electron.App#second-instance
*/
app.on('second-instance', (event, commandLine, workingDirectory) => {
logger.warn('Additional application instance detected:', app.getPath('exe'))
logger.warn('Restoring primary window..')

BrowserWindow.getAllWindows().forEach((browserWindow) => {
browserWindow.restore()
app.focus()
})
})

/**
* @listens Electron.App#before-quit
*/
Expand All @@ -111,29 +160,10 @@ app.once('ready', () => {
logger.debug('app#ready')
})

/**
* Ensure single instance
*/
const isSecondInstance = app.makeSingleInstance(() => {
logger.debug('isSecondInstance', 'primary instance')

logger.warn('Multiple application instances detected', app.getPath('exe'))
logger.warn('Multiple application instances detected', 'Restoring primary application instance')

BrowserWindow.getAllWindows().forEach((browserWindow) => {
browserWindow.restore()
app.focus()
})
})

/**
* Quit additional instances
* @listens Electron.systemPreferences#appearance-changed
*/
if (isSecondInstance) {
logger.debug('isSecondInstance', 'secondary instance')

logger.warn('Multiple application instances detected', app.getPath('exe'))
logger.warn('Multiple application instances detected', 'Shutting down secondary application instances')

app.quit()
}
systemPreferences.on('appearance-changed', (newAppearance) => {
logger.debug('systemPreferences#appearance-changed', 'newAppearance:', newAppearance)
})
Loading

0 comments on commit a5f0d37

Please sign in to comment.