From 13550bac352ecb549c497eeaee30855c10b6a102 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Thu, 30 Nov 2023 06:59:24 +0100 Subject: [PATCH] upd: remove reload from `DisconnectedBehavior` This feature was mainly broken and there is no real way to fix it and as it is mostly not needed it is easier to just remove it. Closes transfem-org/Sharkey#43 --- packages/frontend/src/boot/main-boot.ts | 4 +--- packages/frontend/src/pages/settings/general.vue | 1 - packages/frontend/src/store.ts | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 71236e4c53..72ae8d64a3 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -39,9 +39,7 @@ export async function mainBoot() { let reloadDialogShowing = false; stream.on('_disconnected_', async () => { - if (defaultStore.state.serverDisconnectedBehavior === 'reload') { - location.reload(); - } else if (defaultStore.state.serverDisconnectedBehavior === 'dialog') { + if (defaultStore.state.serverDisconnectedBehavior === 'dialog') { if (reloadDialogShowing) return; reloadDialogShowing = true; const { canceled } = await confirm({ diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index a6257defe6..bbfc8da483 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -166,7 +166,6 @@ SPDX-License-Identifier: AGPL-3.0-only - diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index ebbd65afcb..7844ef0fb5 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -188,7 +188,7 @@ export const defaultStore = markRaw(new Storage('base', { }, serverDisconnectedBehavior: { where: 'device', - default: 'disabled' as 'quiet' | 'reload' | 'dialog' | 'disabled', + default: 'disabled' as 'quiet' | 'dialog' | 'disabled', }, nsfw: { where: 'device',