mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-12 06:30:37 +00:00
Added update ipc handler
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<a class="item" routerLinkActive="active" routerLink="/browse">Browse</a>
|
||||
<a class="item" routerLinkActive="active" routerLink="/library">Library</a>
|
||||
<a class="item" routerLinkActive="active" routerLink="/settings">Settings</a>
|
||||
<a class="item" routerLinkActive="active" routerLink="/about">About</a>
|
||||
<a class="item" routerLinkActive="active" routerLink="/about"><i class="teal small circle icon"></i>About</a>
|
||||
|
||||
<div class="right menu">
|
||||
<a class="item traffic-light" (click)="minimize()"><i class="minus icon"></i></a>
|
||||
|
||||
@@ -1,22 +1,5 @@
|
||||
import { Component, OnInit, ChangeDetectorRef } from '@angular/core'
|
||||
import { ElectronService } from '../../core/services/electron.service'
|
||||
// import { autoUpdater, UpdateInfo } from 'electron-updater'
|
||||
// autoUpdater.autoDownload = false
|
||||
// autoUpdater.on('error', (err) => {})
|
||||
// autoUpdater.on('checking-for-update', () => {})
|
||||
// autoUpdater.on('update-available', (info: UpdateInfo) => {})
|
||||
// autoUpdater.on('update-not-available', () => {})
|
||||
// autoUpdater.on('download-progress', (progress) => {
|
||||
// console.log(progress.bytesPerSecond, progress.percent, progress.transferred, progress.total)
|
||||
// })
|
||||
// autoUpdater.on('update-downloaded', (info: UpdateInfo) => {})
|
||||
// autoUpdater.currentVersion // TODO: display this in the corner or on the about page?
|
||||
// autoUpdater.logger = null
|
||||
// autoUpdater.checkForUpdates()
|
||||
// autoUpdater.downloadUpdate()
|
||||
// autoUpdater.quitAndInstall(false) // By default; autoUpdater installs a downloaded update on the next program restart
|
||||
// TODO: check for updates on initialization; show a button indicating a new version can be downloaded
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-toolbar',
|
||||
@@ -26,6 +9,7 @@ import { ElectronService } from '../../core/services/electron.service'
|
||||
export class ToolbarComponent implements OnInit {
|
||||
|
||||
isMaximized: boolean
|
||||
updateAvailable = false
|
||||
|
||||
constructor(private electronService: ElectronService, private ref: ChangeDetectorRef) { }
|
||||
|
||||
@@ -39,6 +23,10 @@ export class ToolbarComponent implements OnInit {
|
||||
this.isMaximized = true
|
||||
this.ref.detectChanges()
|
||||
})
|
||||
|
||||
this.electronService.receiveIPC('update-available', () => {
|
||||
this.updateAvailable = true
|
||||
})
|
||||
}
|
||||
|
||||
minimize() {
|
||||
|
||||
@@ -33,7 +33,6 @@ export class DownloadService {
|
||||
const thisDownloadIndex = this.downloads.findIndex(download => download.versionID == result.versionID)
|
||||
if (thisDownloadIndex == -1) {
|
||||
this.downloads.push(result)
|
||||
// TODO: this.downloads.sort(downloadSorter)
|
||||
} else {
|
||||
this.downloads[thisDownloadIndex] = result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user