mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 08:20:39 +00: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()
|
app.quit()
|
||||||
}
|
}
|
||||||
isUpdating = true
|
isUpdating = true
|
||||||
|
setDownloadProgress(0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
autoUpdater.on('download-progress', (progressObj: ProgressInfo) => {
|
autoUpdater.on('download-progress', (progressObj: ProgressInfo) => {
|
||||||
|
setDownloadProgress(progressObj.percent)
|
||||||
|
})
|
||||||
|
|
||||||
|
function setDownloadProgress (percent: number): void {
|
||||||
if (mainWindow === undefined) return
|
if (mainWindow === undefined) return
|
||||||
|
|
||||||
mainWindow.setProgressBar(progressObj.percent / 100)
|
mainWindow.setProgressBar(percent / 100)
|
||||||
mainWindow.webContents.send('handle-update-download-progress', progressObj.percent)
|
mainWindow.webContents.send('handle-update-download-progress', percent)
|
||||||
})
|
}
|
||||||
|
|
||||||
autoUpdater.on('update-downloaded', (info) => {
|
autoUpdater.on('update-downloaded', (info) => {
|
||||||
// We have listeners that prevents the app from being exited on mac
|
// 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)
|
setToken('/files/' + workspaceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const upgradeDownloadProgress = writable(0)
|
export const upgradeDownloadProgress = writable(-1)
|
||||||
|
|
||||||
export function setDownloadProgress (percent: number): void {
|
export function setDownloadProgress (percent: number): void {
|
||||||
if (Number.isNaN(percent)) {
|
if (Number.isNaN(percent)) {
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<div class="antiPopup version-popup">
|
<div class="antiPopup version-popup">
|
||||||
<h1><Label label={workbench.string.ServerUnderMaintenance} /></h1>
|
<h1><Label label={workbench.string.ServerUnderMaintenance} /></h1>
|
||||||
{$versionError}
|
{$versionError}
|
||||||
{#if $upgradeDownloadProgress > 0}
|
{#if $upgradeDownloadProgress >= 0}
|
||||||
<div class="mt-1">
|
<div class="mt-1">
|
||||||
<Label label={workbench.string.UpgradeDownloadProgress} params={{ percent: $upgradeDownloadProgress }} />
|
<Label label={workbench.string.UpgradeDownloadProgress} params={{ percent: $upgradeDownloadProgress }} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,8 +68,8 @@
|
|||||||
{$versionError}
|
{$versionError}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if $upgradeDownloadProgress > 0}
|
{#if $upgradeDownloadProgress >= 0}
|
||||||
<div class="ml-2" class:mt-1={$versionError !== undefined}>
|
<div class="ml-1" class:ml-2={$versionError === undefined}>
|
||||||
<Label label={workbench.string.UpgradeDownloadProgress} params={{ percent: $upgradeDownloadProgress }} />
|
<Label label={workbench.string.UpgradeDownloadProgress} params={{ percent: $upgradeDownloadProgress }} />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@ -85,7 +85,7 @@
|
|||||||
<h1><Label label={workbenchRes.string.ServerUnderMaintenance} /></h1>
|
<h1><Label label={workbenchRes.string.ServerUnderMaintenance} /></h1>
|
||||||
{/if}
|
{/if}
|
||||||
{$versionError}
|
{$versionError}
|
||||||
{#if $upgradeDownloadProgress > 0}
|
{#if $upgradeDownloadProgress >= 0}
|
||||||
<div class="mt-1">
|
<div class="mt-1">
|
||||||
<Label
|
<Label
|
||||||
label={workbench.string.UpgradeDownloadProgress}
|
label={workbench.string.UpgradeDownloadProgress}
|
||||||
|
Loading…
Reference in New Issue
Block a user