Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
Lil bit of clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
doZennn committed Dec 2, 2019
1 parent bed5bc3 commit b8ec847
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 48 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"browser": true
},
"extends": ["airbnb"],
"settings": {
"import/core-modules": ["electron"]
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly",
Expand Down
88 changes: 44 additions & 44 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
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');
const url = require('url');

autoUpdater.autoInstallOnAppQuit = true;

log.catchErrors({showDialog: true});
log.catchErrors({ showDialog: true });

log.info(`Started SGDB Manager ${app.getVersion()}`);

// Keep a global reference of the window object, if you don't, the window will
// 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
Expand All @@ -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();
}
});
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b8ec847

Please sign in to comment.