Skip to content

Commit

Permalink
Re-enable auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Dec 23, 2023
1 parent d9aa7b8 commit 2114cf2
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

Expand Down
44 changes: 41 additions & 3 deletions main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const audio = require('./windows/audio')
const player = require('./windows/player')
const AudioLibrary = require('./lib/audio-library')
const log = require('electron-log')
const autoUpdater = require('electron-updater').autoUpdater

// handle uncaught exceptions before calling any functions
process.on('uncaughtException', (err) => {
Expand Down Expand Up @@ -88,6 +89,43 @@ app.on('ready', function appReady () {
ipcMain.on('recall', recall)
ipcMain.on('sync-state', syncState)

// register autoUpdater
if (!process.env.DEV_SERVER) {
setTimeout(() => {
log.info('autoUpdater: Auto update initalized...')
autoUpdater.checkForUpdatesAndNotify()
}, 1000 * 3)
}

autoUpdater.on('error', (err) => {
broadcast('au:error', err)
console.error(err)
})

autoUpdater.on('checking-for-update', () => {
log.info('autoUpdater: Checking for update...')
broadcast('au:checking-for-update')
})

autoUpdater.on('update-available', (info) => {
log.info('autoUpdater: Update available!')
broadcast('au:update-available', info)
})

autoUpdater.on('update-not-available', (info) => {
log.info('autoUpdater: No update available')
broadcast('au:update-not-available', info)
})

autoUpdater.on('download-progress', (progress) => {
broadcast('au:progress', progress)
})

autoUpdater.on('update-downloaded', (info) => {
log.info('autoUpdater: Update downloaded')
broadcast('au:update-downloaded', info)
})

// ACTIONS
// NOTE: I really don't like having all of these actions stuck in this scope.
// Would be nice to move this to a separate file eventually. -ungoldman
Expand Down Expand Up @@ -156,9 +194,9 @@ app.on('ready', function appReady () {
broadcast('paused')
}

function playPause () {
state.playing ? pause() : play()
}
// function playPause () {
// state.playing ? pause() : play()
// }

function prev () {
broadcast('new-track', al.prev())
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"electron-default-menu": "^1.0.1",
"electron-log": "^5.0.0-beta.16",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.7",
"electron-window-state": "^5.0.2",
"entypo": "^2.1.0",
"existy": "^1.0.1",
Expand Down
1 change: 1 addition & 0 deletions renderer/audio/audio-player.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env browser */
const Nanobus = require('nanobus')
const window = require('global/window')
const get = require('lodash.get')
Expand Down
1 change: 0 additions & 1 deletion renderer/audio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const path = require('path')
const mainState = remote.require('./index.js')
const needle = 'file://' + path.resolve(__dirname, 'needle.mp3')
let startupNode = document.querySelector('#needle')
const fileUrlFromPath = require('../shared/file-url')

needleSound(startupNode, needle, mainState.volume, mainState.muted)

Expand Down

0 comments on commit 2114cf2

Please sign in to comment.