diff --git a/package.json b/package.json index 069aaf9e..e9c6d59f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "location-history": "^1.0.0", "material-ui": "^0.17.0", "mkdirp": "^0.5.1", - "music-metadata": "^1.0.0", + "music-metadata": "^1.1.0", "network-address": "^1.1.0", "parse-torrent": "^6.0.1", "prettier-bytes": "^1.0.1", diff --git a/src/main/handlers.js b/src/main/handlers.js index dfef92c8..3c42e443 100644 --- a/src/main/handlers.js +++ b/src/main/handlers.js @@ -229,7 +229,7 @@ function uninstallWin32 () { hive: Registry.HKCU, key: `\\Software\\Classes\\${protocol}` }) - protocolKey.destroy(() => { }) + protocolKey.destroy(() => {}) } } @@ -261,7 +261,7 @@ function uninstallWin32 () { hive: Registry.HKCU, // HKEY_CURRENT_USER key: `\\Software\\Classes\\${ext}` }) - extKey.destroy(() => { }) + extKey.destroy(() => {}) } } } diff --git a/src/main/windows/main.js b/src/main/windows/main.js index 6898ebfd..f310ad70 100644 --- a/src/main/windows/main.js +++ b/src/main/windows/main.js @@ -57,7 +57,7 @@ function init (state, options) { win.setSheetOffset(config.UI_HEADER_HEIGHT) } - win.webContents.on('dom-ready', function () { + win.webContents.on('dom-ready', () => { menu.onToggleFullScreen(main.win.isFullScreen()) }) @@ -73,27 +73,27 @@ function init (state, options) { win.on('hide', onWindowBlur) win.on('show', onWindowFocus) - win.on('enter-full-screen', function () { + win.on('enter-full-screen', () => { menu.onToggleFullScreen(true) send('fullscreenChanged', true) win.setMenuBarVisibility(false) }) - win.on('leave-full-screen', function () { + win.on('leave-full-screen', () => { menu.onToggleFullScreen(false) send('fullscreenChanged', false) win.setMenuBarVisibility(true) }) - win.on('move', debounce(function (e) { + win.on('move', debounce(e => { send('windowBoundsChanged', e.sender.getBounds()) }, 1000)) - win.on('resize', debounce(function (e) { + win.on('resize', debounce(e => { send('windowBoundsChanged', e.sender.getBounds()) }, 1000)) - win.on('close', function (e) { + win.on('close', e => { if (process.platform !== 'darwin') { const tray = require('../tray') if (!tray.hasTray()) { @@ -143,23 +143,15 @@ function setBounds (bounds, maximize) { } // Maximize or minimize, if the second argument is present - let willBeMaximized - if (maximize === true) { - if (!main.win.isMaximized()) { - log('setBounds: maximizing') - main.win.maximize() - } - willBeMaximized = true - } else if (maximize === false) { - if (main.win.isMaximized()) { - log('setBounds: unmaximizing') - main.win.unmaximize() - } - willBeMaximized = false - } else { - willBeMaximized = main.win.isMaximized() + if (maximize === true && !main.win.isMaximized()) { + log('setBounds: maximizing') + main.win.maximize() + } else if (maximize === false && main.win.isMaximized()) { + log('setBounds: unmaximizing') + main.win.unmaximize() } + const willBeMaximized = typeof maximize === 'boolean' ? maximize : main.win.isMaximized() // Assuming we're not maximized or maximizing, set the window size if (!willBeMaximized) { log(`setBounds: setting bounds to ${JSON.stringify(bounds)}`)