From 14937d13bf39e0e01c74f26192ff5fbd094c1379 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Thu, 19 Sep 2024 21:31:54 +0400 Subject: [PATCH] Qfix desktop upgrade (#6643) Signed-off-by: Alexey Zinoviev --- plugins/guest-resources/src/connect.ts | 18 ++++++++++++++---- plugins/workbench-resources/src/connect.ts | 11 ++++++++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/plugins/guest-resources/src/connect.ts b/plugins/guest-resources/src/connect.ts index 6f0c47839a..532657821f 100644 --- a/plugins/guest-resources/src/connect.ts +++ b/plugins/guest-resources/src/connect.ts @@ -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(undefined) const versionStorageKey = 'last_server_version' @@ -84,9 +90,13 @@ export async function connect (title: string): Promise { } 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 } } diff --git a/plugins/workbench-resources/src/connect.ts b/plugins/workbench-resources/src/connect.ts index 629d28b96c..3e7e27a29a 100644 --- a/plugins/workbench-resources/src/connect.ts +++ b/plugins/workbench-resources/src/connect.ts @@ -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 { } 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 } }