mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-09 05:09:39 +00:00
Fix auto-updater
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<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-10 cursor-default" routerLinkActive="btn-active" routerLink="/browse">Browse</button>
|
||||
<button class="btn btn-square btn-ghost rounded-none px-11 cursor-default" routerLinkActive="btn-active" routerLink="/browse">Browse</button>
|
||||
<!-- TODO <a class="btn btn-square btn-ghost rounded-none cursor-default" routerLinkActive="btn-active" routerLink="/library">Library</a> -->
|
||||
<button class="btn btn-square btn-ghost rounded-none px-10 cursor-default" routerLinkActive="btn-active" routerLink="/settings">
|
||||
<i *ngIf="updateAvailable" class="teal small circle icon"></i>
|
||||
<i *ngIf="updateAvailable === null" class="small yellow exclamation triangle icon"></i>
|
||||
<button class="btn btn-square btn-ghost rounded-none px-11 cursor-default 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>
|
||||
Settings
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { UpdateProgress } from '../../src-shared/interfaces/update.interface'
|
||||
import { emitIpcEvent } from '../main'
|
||||
|
||||
let updateAvailable: boolean | null = false
|
||||
let downloading = false
|
||||
|
||||
autoUpdater.autoDownload = false
|
||||
autoUpdater.logger = null
|
||||
@@ -49,8 +50,8 @@ export async function getCurrentVersion() {
|
||||
* Begins the process of downloading the latest update.
|
||||
*/
|
||||
export function downloadUpdate() {
|
||||
if (this.downloading) { return }
|
||||
this.downloading = true
|
||||
if (downloading) { return }
|
||||
downloading = true
|
||||
|
||||
autoUpdater.on('download-progress', (updateProgress: UpdateProgress) => {
|
||||
emitIpcEvent('updateProgress', updateProgress)
|
||||
|
||||
Reference in New Issue
Block a user