Qfix desktop upgrade (#6643)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2024-09-19 21:31:54 +04:00 committed by GitHub
parent 42c602ee67
commit 14937d13bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 7 deletions

View File

@ -18,7 +18,13 @@ import presentation, {
setClient,
setPresentationCookie
} from '@hcengineering/presentation'
import { fetchMetadataLocalStorage, getCurrentLocation, navigate, setMetadataLocalStorage } from '@hcengineering/ui'
import {
embeddedPlatform,
fetchMetadataLocalStorage,
getCurrentLocation,
navigate,
setMetadataLocalStorage
} from '@hcengineering/ui'
import { writable } from 'svelte/store'
export const versionError = writable<string | undefined>(undefined)
const versionStorageKey = 'last_server_version'
@ -84,9 +90,13 @@ export async function connect (title: string): Promise<Client | undefined> {
} else {
versionError.set(`Front version ${frontVersion} is not in sync with server version ${serverVersion}`)
setTimeout(() => {
location.reload()
}, 5000)
if (!embeddedPlatform) {
setTimeout(() => {
location.reload()
}, 5000)
}
// For embedded it should download the upgrade and restart the app
return false
}
}

View File

@ -27,6 +27,7 @@ import presentation, {
uiContext
} from '@hcengineering/presentation'
import {
embeddedPlatform,
fetchMetadataLocalStorage,
getCurrentLocation,
locationStorageKeyId,
@ -170,9 +171,13 @@ export async function connect (title: string): Promise<Client | undefined> {
} else {
versionError.set(`Front version ${frontVersion} is not in sync with server version ${serverVersion}`)
setTimeout(() => {
location.reload()
}, 5000)
if (!embeddedPlatform) {
setTimeout(() => {
location.reload()
}, 5000)
}
// For embedded it should download the upgrade and restart the app
return false
}
}