Skip to content

Commit

Permalink
feat: 1.2.0-beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
nijikokun committed Sep 17, 2017
1 parent 9061acb commit 6819cea
Show file tree
Hide file tree
Showing 9 changed files with 18,362 additions and 1,397 deletions.
5 changes: 5 additions & 0 deletions build.sh
@@ -0,0 +1,5 @@
docker run --rm -ti -v ${PWD}:/project \
-v ${PWD##*/}-node-modules:/project/node_modules \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/electron-builder:wine
22 changes: 15 additions & 7 deletions main.js
Expand Up @@ -19,11 +19,15 @@ if ( process.defaultApp || /[\\/]electron-prebuilt[\\/]/.test(process.execPath)

function createWindow () {
autoUpdater.checkForUpdates()
.catch(e => {
console.log('No updates found...')
})

// Create the browser window.
mainWindow = new BrowserWindow({
title: 'Currency Cop',
icon: __dirname + '/resources/icon.ico',
backgroundColor: 'rgb(25, 25, 25)',
width: 1024,
height: 768,
show: false,
Expand Down Expand Up @@ -83,10 +87,16 @@ function createWindow () {
}

// Configure autoupdater
let platform = process.platform === 'darwin'
? 'osx'
: 'windows'

autoUpdater.autoDownload = false
autoUpdater.setFeedURL(`https://poe.technology/update/${platform}/${app.getVersion()}`)

// Listen
autoUpdater.on('checking-for-update', () => {
autoUpdater.on('checking-for-update', (info) => {
console.log('checking...', info)
})

autoUpdater.on('update-available', (info) => {
Expand Down Expand Up @@ -143,15 +153,13 @@ app.on('ready', createWindow);
app.on('window-all-closed', () => {
// On macOS 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.quit()
})

app.on('activate', () => {
// On macOS 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();
createWindow()
}
});
})

0 comments on commit 6819cea

Please sign in to comment.