diff --git a/packages/frontend/src/components/global/MkCustomEmoji.vue b/packages/frontend/src/components/global/MkCustomEmoji.vue
index b01a172a60..4029bfa855 100644
--- a/packages/frontend/src/components/global/MkCustomEmoji.vue
+++ b/packages/frontend/src/components/global/MkCustomEmoji.vue
@@ -39,7 +39,7 @@ const rawUrl = computed(() => {
const url = computed(() => {
if (rawUrl.value == null) return null;
const useOriginalSize = props.useOriginalSize;
- const enableDataSaverMode = defaultStore.state.enableDataSaverMode;
+ const enableDataSaverMode = defaultStore.state.enableUltimateDataSaverMode;
let datasaver_result ;
if (enableDataSaverMode) {
datasaver_result = useOriginalSize ? undefined : 'datasaver';
diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue
index e5b0d7b63f..962b800d40 100644
--- a/packages/frontend/src/pages/settings/general.vue
+++ b/packages/frontend/src/pages/settings/general.vue
@@ -113,8 +113,10 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.useSystemFont }}
{{ i18n.ts.disableDrawer }}
{{ i18n.ts.forceShowAds }}
- {{ i18n.ts.dataSaver }}
- {{ i18n.ts.cellularWithDataSaver }}
+ {{ i18n.ts.dataSaver }}
+ {{ i18n.ts.cellularWithDataSaver }}
+ {{ i18n.ts.UltimateDataSaver }}
+ {{ i18n.ts.cellularWithUltimateDataSaver }}
@@ -230,6 +232,8 @@ const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds'));
const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages'));
const enableDataSaverMode = computed(defaultStore.makeGetterSetter('enableDataSaverMode')) ;
const enableCellularWithDataSaver = computed(defaultStore.makeGetterSetter('enableCellularWithDataSaver'));
+const enableUltimateDataSaverMode = computed(defaultStore.makeGetterSetter('enableUltimateDataSaverMode'))
+const enableCellularWithUltimateDataSaver = computed(defaultStore.makeGetterSetter('enableCellularWithUltimateDataSaver'));
const imageNewTab = computed(defaultStore.makeGetterSetter('imageNewTab'));
const nsfw = computed(defaultStore.makeGetterSetter('nsfw'));
const showFixedPostForm = computed(defaultStore.makeGetterSetter('showFixedPostForm'));
@@ -244,6 +248,8 @@ const notificationPosition = computed(defaultStore.makeGetterSetter('notificatio
const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis'));
const showTimelineReplies = computed(defaultStore.makeGetterSetter('showTimelineReplies'));
+
+
watch(lang, () => {
miLocalStorage.setItem('lang', lang.value as string);
miLocalStorage.removeItem('locale');
diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts
index 06aabba7f6..0b16391777 100644
--- a/packages/frontend/src/store.ts
+++ b/packages/frontend/src/store.ts
@@ -204,10 +204,18 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: false,
},
+ enableUltimateDataSaverMode: {
+ where: 'device',
+ default: false,
+ },
enableCellularWithDataSaver: {
where: 'device',
default: false,
},
+ enableCellularWithUltimateDataSaver: {
+ where: 'device',
+ default: false,
+ },
disableShowingAnimatedImages: {
where: 'device',
default: window.matchMedia('(prefers-reduced-motion)').matches,
diff --git a/packages/frontend/src/ui/universal.vue b/packages/frontend/src/ui/universal.vue
index 1bede0c14c..7fc8043dd8 100644
--- a/packages/frontend/src/ui/universal.vue
+++ b/packages/frontend/src/ui/universal.vue
@@ -130,6 +130,18 @@ const DESKTOP_THRESHOLD = 1100;
const MOBILE_THRESHOLD = 500;
onMounted(() => {
+ if (
+ window.navigator.connection.type === "cellular" &&
+ !defaultStore.state.enableUltimateDataSaverMode &&
+ defaultStore.state.enableCellularWithUltimateDataSaver
+ ) {
+ defaultStore.state.enableDataSaverMode = true;
+ defaultStore.state.enableUltimateDataSaverMode = true;
+ } else if (window.navigator.connection.type !== "cellular" && window.navigator.connection.type !== "undefined" && defaultStore.state.enableDataSaverMode && defaultStore.state.enableCellularWithDataSaver) {
+ defaultStore.state.enableDataSaverMode = false;
+ defaultStore.state.enableUltimateDataSaverMode = true;
+ }
+
if (
window.navigator.connection.type === "cellular" &&
!defaultStore.state.enableDataSaverMode &&
@@ -140,6 +152,9 @@ onMounted(() => {
} else if (window.navigator.connection.type !== "cellular" && window.navigator.connection.type !== "undefined" && defaultStore.state.enableDataSaverMode && defaultStore.state.enableCellularWithDataSaver) {
defaultStore.state.enableDataSaverMode = false;
}
+ if (defaultStore.state.enableUltimateDataSaverMode) {
+ defaultStore.state.enableDataSaverMode = true;
+ }
});
// デスクトップでウィンドウを狭くしたときモバイルUIが表示されて欲しいことはあるので deviceKind === 'desktop' の判定は行わない
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);
diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts
index 637ae677b8..abd483bbe8 100644
--- a/packages/frontend/vite.config.ts
+++ b/packages/frontend/vite.config.ts
@@ -50,7 +50,7 @@ export function getConfig(): UserConfig {
},
plugins: [
- compression(),
+ compression({ algorithm: 'brotliCompress'}),
pluginVue({
reactivityTransform: true,
}),