Improve update UI

This commit is contained in:
Geomitron
2024-07-10 23:15:38 -05:00
parent ba357d5fea
commit 0c8b20c3e9
9 changed files with 53 additions and 39 deletions

View File

@@ -7,7 +7,7 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'
export class ToolbarComponent implements OnInit {
isMaximized: boolean
updateAvailable: boolean | null = false
updateAvailable: 'yes' | 'no' | 'error' = 'no'
constructor(private ref: ChangeDetectorRef) { }
@@ -23,11 +23,11 @@ export class ToolbarComponent implements OnInit {
})
window.electron.on.updateAvailable(result => {
this.updateAvailable = result !== null
this.updateAvailable = result !== null ? 'yes' : 'no'
this.ref.detectChanges()
})
window.electron.on.updateError(() => {
this.updateAvailable = null
this.updateAvailable = 'error'
this.ref.detectChanges()
})
this.updateAvailable = await window.electron.invoke.getUpdateAvailable()