mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
uberf-8301: improve desktop app update UX (#6808)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
parent
70a1666a57
commit
fc9e15f7e6
@ -385,15 +385,20 @@ autoUpdater.on('update-available', (info: UpdateInfo) => {
|
||||
app.quit()
|
||||
}
|
||||
isUpdating = true
|
||||
setDownloadProgress(0)
|
||||
})
|
||||
})
|
||||
|
||||
autoUpdater.on('download-progress', (progressObj: ProgressInfo) => {
|
||||
setDownloadProgress(progressObj.percent)
|
||||
})
|
||||
|
||||
function setDownloadProgress (percent: number): void {
|
||||
if (mainWindow === undefined) return
|
||||
|
||||
mainWindow.setProgressBar(progressObj.percent / 100)
|
||||
mainWindow.webContents.send('handle-update-download-progress', progressObj.percent)
|
||||
})
|
||||
mainWindow.setProgressBar(percent / 100)
|
||||
mainWindow.webContents.send('handle-update-download-progress', percent)
|
||||
}
|
||||
|
||||
autoUpdater.on('update-downloaded', (info) => {
|
||||
// We have listeners that prevents the app from being exited on mac
|
||||
|
@ -687,7 +687,7 @@ export function setPresentationCookie (token: string, workspaceId: string): void
|
||||
setToken('/files/' + workspaceId)
|
||||
}
|
||||
|
||||
export const upgradeDownloadProgress = writable(0)
|
||||
export const upgradeDownloadProgress = writable(-1)
|
||||
|
||||
export function setDownloadProgress (percent: number): void {
|
||||
if (Number.isNaN(percent)) {
|
||||
|
@ -32,7 +32,7 @@
|
||||
<div class="antiPopup version-popup">
|
||||
<h1><Label label={workbench.string.ServerUnderMaintenance} /></h1>
|
||||
{$versionError}
|
||||
{#if $upgradeDownloadProgress > 0}
|
||||
{#if $upgradeDownloadProgress >= 0}
|
||||
<div class="mt-1">
|
||||
<Label label={workbench.string.UpgradeDownloadProgress} params={{ percent: $upgradeDownloadProgress }} />
|
||||
</div>
|
||||
|
@ -68,8 +68,8 @@
|
||||
{$versionError}
|
||||
</div>
|
||||
{/if}
|
||||
{#if $upgradeDownloadProgress > 0}
|
||||
<div class="ml-2" class:mt-1={$versionError !== undefined}>
|
||||
{#if $upgradeDownloadProgress >= 0}
|
||||
<div class="ml-1" class:ml-2={$versionError === undefined}>
|
||||
<Label label={workbench.string.UpgradeDownloadProgress} params={{ percent: $upgradeDownloadProgress }} />
|
||||
</div>
|
||||
{/if}
|
||||
@ -85,7 +85,7 @@
|
||||
<h1><Label label={workbenchRes.string.ServerUnderMaintenance} /></h1>
|
||||
{/if}
|
||||
{$versionError}
|
||||
{#if $upgradeDownloadProgress > 0}
|
||||
{#if $upgradeDownloadProgress >= 0}
|
||||
<div class="mt-1">
|
||||
<Label
|
||||
label={workbench.string.UpgradeDownloadProgress}
|
||||
|
Loading…
Reference in New Issue
Block a user