Unify useBlurEffect and useBlurEffectForModal

This commit is contained in:
Aylam 2023-08-26 10:01:04 +03:00
parent 2b72cb0b09
commit 6fc8415b00
4 changed files with 6 additions and 22 deletions

View File

@ -363,17 +363,6 @@ function checkForSplash() {
}
});
watch(
defaultStore.reactiveState.useBlurEffectForModal,
(v) => {
document.documentElement.style.setProperty(
"--modalBgFilter",
v ? "blur(4px)" : "none",
);
},
{ immediate: true },
);
watch(
defaultStore.reactiveState.useBlurEffect,
(v) => {
@ -382,6 +371,12 @@ function checkForSplash() {
} else {
document.documentElement.style.setProperty("--blur", "none");
}
document.documentElement.style.setProperty(
"--modalBgFilter",
v ? "blur(4px)" : "none",
);
const theme = defaultStore.state.darkMode ? ColdDeviceStorage.get("darkTheme") : ColdDeviceStorage.get("lightTheme");
applyTheme(theme);
},

View File

@ -159,9 +159,6 @@
<FormSwitch v-model="useBlurEffect" class="_formBlock">{{
i18n.ts.useBlurEffect
}}</FormSwitch>
<FormSwitch v-model="useBlurEffectForModal" class="_formBlock">{{
i18n.ts.useBlurEffectForModal
}}</FormSwitch>
<FormSwitch
v-model="showGapBetweenNotesInTimeline"
class="_formBlock"
@ -303,9 +300,6 @@ const reduceAnimation = computed(
(v) => !v,
),
);
const useBlurEffectForModal = computed(
defaultStore.makeGetterSetter("useBlurEffectForModal"),
);
const useBlurEffect = computed(defaultStore.makeGetterSetter("useBlurEffect"));
const showGapBetweenNotesInTimeline = computed(
defaultStore.makeGetterSetter("showGapBetweenNotesInTimeline"),

View File

@ -92,7 +92,6 @@ const defaultStoreSaveKeys: (keyof (typeof defaultStore)["state"])[] = [
"enterSendsMessage",
"useOsNativeEmojis",
"disableDrawer",
"useBlurEffectForModal",
"useBlurEffect",
"showFixedPostForm",
"enableInfiniteScroll",

View File

@ -202,10 +202,6 @@ export const defaultStore = markRaw(
where: "device",
default: false,
},
useBlurEffectForModal: {
where: "device",
default: true,
},
useBlurEffect: {
where: "device",
default: true,