mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-15 00:50:03 +00:00
avoid double squirrel check
This commit is contained in:
parent
9e7721d2a9
commit
38045165d4
@ -10,7 +10,7 @@ const UPDATES_URL = 'https://api.github.com/repos/eugeny/terminus/releases/lates
|
|||||||
export class UpdaterService {
|
export class UpdaterService {
|
||||||
private logger: Logger
|
private logger: Logger
|
||||||
private downloaded: Promise<boolean>
|
private downloaded: Promise<boolean>
|
||||||
private isSquirrel = false
|
private isSquirrel = true
|
||||||
private updateURL: string
|
private updateURL: string
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
@ -21,8 +21,8 @@ export class UpdaterService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
electron.autoUpdater.setFeedURL(`https://terminus-updates.herokuapp.com/update/${os.platform()}/${electron.app.getVersion()}`)
|
electron.autoUpdater.setFeedURL(`https://terminus-updates.herokuapp.com/update/${os.platform()}/${electron.app.getVersion()}`)
|
||||||
this.isSquirrel = true
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
this.isSquirrel = false
|
||||||
this.logger.info('Squirrel updater unavailable, falling back')
|
this.logger.info('Squirrel updater unavailable, falling back')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,10 +39,13 @@ export class UpdaterService {
|
|||||||
|
|
||||||
this.logger.debug('Checking for updates')
|
this.logger.debug('Checking for updates')
|
||||||
|
|
||||||
try {
|
if (this.isSquirrel) {
|
||||||
this.electron.autoUpdater.checkForUpdates()
|
try {
|
||||||
} catch (e) {
|
this.electron.autoUpdater.checkForUpdates()
|
||||||
this.logger.info('Squirrel updater unavailable, falling back')
|
} catch (e) {
|
||||||
|
this.isSquirrel = false
|
||||||
|
this.logger.info('Squirrel updater unavailable, falling back')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user