Reload when upgrade (#5942)

This commit is contained in:
Denis Bykhov
2024-06-28 22:11:35 +07:00
committed by GitHub
parent bb87db700c
commit 4fb5ca1d17
5 changed files with 10 additions and 12 deletions
+2 -1
View File
@@ -196,7 +196,7 @@ export async function connect (title: string): Promise<Client | undefined> {
if (currentVersionStr !== reconnectVersionStr) {
// It seems upgrade happened
// location.reload()
location.reload()
versionError.set(`${currentVersionStr} != ${reconnectVersionStr}`)
}
const serverVersion: { version: string } = await ctx.with(
@@ -211,6 +211,7 @@ export async function connect (title: string): Promise<Client | undefined> {
version !== undefined ? versionToString(version) : ''
)
if (serverVersion.version !== '' && serverVersion.version !== currentVersionStr) {
location.reload()
versionError.set(`${currentVersionStr} => ${serverVersion.version}`)
} else {
versionError.set(undefined)