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( watch(
defaultStore.reactiveState.useBlurEffect, defaultStore.reactiveState.useBlurEffect,
(v) => { (v) => {
@ -382,6 +371,12 @@ function checkForSplash() {
} else { } else {
document.documentElement.style.setProperty("--blur", "none"); 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"); const theme = defaultStore.state.darkMode ? ColdDeviceStorage.get("darkTheme") : ColdDeviceStorage.get("lightTheme");
applyTheme(theme); applyTheme(theme);
}, },

View File

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

View File

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

View File

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