mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Improve update UI
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<div class="navbar p-0 min-h-0 bg-base-100" style="-webkit-app-region: drag">
|
||||
<div style="-webkit-app-region: no-drag">
|
||||
<button class="btn btn-square btn-ghost rounded-none px-11" routerLinkActive="btn-active" routerLink="/browse">Browse</button>
|
||||
<!-- TODO <a class="btn btn-square btn-ghost rounded-none" routerLinkActive="btn-active" routerLink="/library">Library</a> -->
|
||||
<button class="btn btn-square btn-ghost rounded-none px-11 flex flex-nowrap" routerLinkActive="btn-active" routerLink="/settings">
|
||||
<div *ngIf="updateAvailable" class="badge badge-accent badge-xs"></div>
|
||||
<i *ngIf="updateAvailable === null" class="bi bi-exclamation-triangle-fill text-warning"></i>
|
||||
<button class="btn btn-ghost rounded-none" routerLinkActive="btn-active" routerLink="/browse">Browse</button>
|
||||
<!-- TODO <a class="btn btn-ghost rounded-none" routerLinkActive="btn-active" routerLink="/library">Library</a> -->
|
||||
<button class="btn btn-ghost rounded-none flex flex-nowrap" routerLinkActive="btn-active" routerLink="/settings">
|
||||
<i *ngIf="updateAvailable === 'error'" class="bi bi-exclamation-triangle-fill text-warning"></i>
|
||||
Settings
|
||||
<div *ngIf="updateAvailable === 'yes'" class="badge badge-accent badge-sm">Update Available</div>
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex-1"></div>
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user