fix: only show option based on device + add option to backups

This commit is contained in:
freeplay 2023-06-26 21:50:02 -04:00
parent e17497e668
commit 8cb5f581a8
2 changed files with 8 additions and 2 deletions

View file

@ -45,10 +45,10 @@
class="_formBlock"
>{{ i18n.ts.useReactionPickerForContextMenu }}</FormSwitch
>
<FormSwitch v-model="swipeOnMobile" class="_formBlock">{{
<FormSwitch v-if="deviceKind !== 'desktop'" v-model="swipeOnMobile" class="_formBlock">{{
i18n.ts.swipeOnMobile
}}</FormSwitch>
<FormSwitch v-model="swipeOnDesktop" class="_formBlock">{{
<FormSwitch v-if="deviceKind === 'desktop'" v-model="swipeOnDesktop" class="_formBlock">{{
i18n.ts.swipeOnDesktop
}}</FormSwitch>
<FormSwitch v-model="enterSendsMessage" class="_formBlock">{{
@ -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");

View file

@ -110,6 +110,7 @@ const defaultStoreSaveKeys: (keyof (typeof defaultStore)["state"])[] = [
"squareAvatars",
"numberOfPageCache",
"showUpdates",
"swipeOnMobile",
"swipeOnDesktop",
"showAdminUpdates",
"enableCustomKaTeXMacro",