diff --git a/.eslintrc.json b/.eslintrc.json index 5037e76..7854392 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,6 +6,9 @@ "browser": true }, "extends": ["airbnb"], + "settings": { + "import/core-modules": ["electron"] + }, "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly", diff --git a/main.js b/main.js index 148048e..9ce8909 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,5 @@ -const {app, globalShortcut, BrowserWindow} = require('electron'); -const {autoUpdater} = require('electron-updater'); +const { app, globalShortcut, BrowserWindow } = require('electron'); +const { autoUpdater } = require('electron-updater'); const log = require('electron-log'); const path = require('path'); @@ -7,7 +7,7 @@ const url = require('url'); autoUpdater.autoInstallOnAppQuit = true; -log.catchErrors({showDialog: true}); +log.catchErrors({ showDialog: true }); log.info(`Started SGDB Manager ${app.getVersion()}`); @@ -15,41 +15,41 @@ log.info(`Started SGDB Manager ${app.getVersion()}`); // be closed automatically when the JavaScript object is garbage collected. let mainWindow; -function createWindow () { - autoUpdater.checkForUpdatesAndNotify(); - mainWindow = new BrowserWindow({ - width: 800, - height: 600, - frame:false, - icon: path.join(__dirname, 'assets/icons/192x192.png'), - transparent: false, - webPreferences: { - nodeIntegration: true - } - }); +function createWindow() { + autoUpdater.checkForUpdatesAndNotify(); + mainWindow = new BrowserWindow({ + width: 800, + height: 600, + frame: false, + icon: path.join(__dirname, 'assets/icons/192x192.png'), + transparent: false, + webPreferences: { + nodeIntegration: true, + }, + }); - mainWindow.loadURL(url.format({ - pathname: path.join(__dirname, 'public', 'index.html'), - protocol: 'file:', - slashes: true - })); + mainWindow.loadURL(url.format({ + pathname: path.join(__dirname, 'public', 'index.html'), + protocol: 'file:', + slashes: true, + })); - // Open the DevTools. - globalShortcut.register('CommandOrControl+Shift+L', () => { - mainWindow.webContents.openDevTools(); - }); + // Open the DevTools. + globalShortcut.register('CommandOrControl+Shift+L', () => { + mainWindow.webContents.openDevTools(); + }); - mainWindow.on('beforeunload', () => { - globalShortcut.unregisterAll(); - }); + mainWindow.on('beforeunload', () => { + globalShortcut.unregisterAll(); + }); - // Emitted when the window is closed. - mainWindow.on('closed', () => { - // Dereference the window object, usually you would store windows - // in an array if your app supports multi windows, this is the time - // when you should delete the corresponding element. - mainWindow = null; - }); + // Emitted when the window is closed. + mainWindow.on('closed', () => { + // Dereference the window object, usually you would store windows + // in an array if your app supports multi windows, this is the time + // when you should delete the corresponding element. + mainWindow = null; + }); } // This method will be called when Electron has finished @@ -59,17 +59,17 @@ app.on('ready', createWindow); // Quit when all windows are closed. app.on('window-all-closed', () => { - // On OS X it is common for applications and their menu bar - // to stay active until the user quits explicitly with Cmd + Q - if (process.platform !== 'darwin') { - app.quit(); - } + // On OS X it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + if (process.platform !== 'darwin') { + app.quit(); + } }); app.on('activate', () => { - // On OS X it's common to re-create a window in the app when the - // dock icon is clicked and there are no other windows open. - if (mainWindow === null) { - createWindow(); - } + // On OS X it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (mainWindow === null) { + createWindow(); + } }); diff --git a/package-lock.json b/package-lock.json index 91caeab..6837d2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9935,9 +9935,9 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" }, "steam-categories": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/steam-categories/-/steam-categories-1.1.0.tgz", - "integrity": "sha512-sG6Bdv8iu3LeurHzW7FaGIGmWz6p34jxglH58T2iPJcTs3w/6bzlXXLEollM15auy76rTdjxwrEFGeieq4Ytcw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/steam-categories/-/steam-categories-1.1.1.tgz", + "integrity": "sha512-t828pYRTrc/sGokR0hrAsk6JYLDMJKJFPFgfgXV9uZC2w8WrLUOw6vLYQZwxCXKFKh7lKKdmZMTSck1k2jFA5Q==", "requires": { "level": "^6.0.0" } diff --git a/package.json b/package.json index d7c6d89..6950bf0 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "react-router-dom": "^5.1.2", "react-transition-group": "1.2.1", "react-uwp": "^1.2.31", - "steam-categories": "^1.1.0", + "steam-categories": "^1.1.1", "steam-shortcut-editor": "^3.1.1", "steamgriddb": "^1.3.1", "steamid": "^1.1.3",