From 8cb5f581a805367513ff88748efc5df047e1726e Mon Sep 17 00:00:00 2001 From: freeplay Date: Mon, 26 Jun 2023 21:50:02 -0400 Subject: [PATCH] fix: only show option based on device + add option to backups --- packages/client/src/pages/settings/general.vue | 9 +++++++-- .../client/src/pages/settings/preferences-backups.vue | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 6a9af2412..0add2b9df 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -45,10 +45,10 @@ class="_formBlock" >{{ i18n.ts.useReactionPickerForContextMenu }} - {{ + {{ i18n.ts.swipeOnMobile }} - {{ + {{ i18n.ts.swipeOnDesktop }} {{ @@ -256,6 +256,7 @@ import * as os from "@/os"; import { unisonReload } from "@/scripts/unison-reload"; import { i18n } from "@/i18n"; import { definePageMetadata } from "@/scripts/page-metadata"; +import { deviceKind } from "@/scripts/device-kind"; const lang = ref(localStorage.getItem("lang")); const fontSize = ref(localStorage.getItem("fontSize")); @@ -350,6 +351,10 @@ const showTimelineReplies = computed( defaultStore.makeGetterSetter("showTimelineReplies") ); +watch(swipeOnDesktop, () => { + defaultStore.set("swipeOnMobile", true); +}); + watch(lang, () => { localStorage.setItem("lang", lang.value as string); localStorage.removeItem("locale"); diff --git a/packages/client/src/pages/settings/preferences-backups.vue b/packages/client/src/pages/settings/preferences-backups.vue index 313024d86..15fd804bf 100644 --- a/packages/client/src/pages/settings/preferences-backups.vue +++ b/packages/client/src/pages/settings/preferences-backups.vue @@ -110,6 +110,7 @@ const defaultStoreSaveKeys: (keyof (typeof defaultStore)["state"])[] = [ "squareAvatars", "numberOfPageCache", "showUpdates", + "swipeOnMobile", "swipeOnDesktop", "showAdminUpdates", "enableCustomKaTeXMacro",