= {
:width="card.width"
:height="card.height"
:alt="alt"
+ :should-load-image="shouldLoadAttachment"
w-full h-full object-cover
+ :class="!shouldLoadAttachment ? 'brightness-60' : ''"
/>
+
= {
+
+
diff --git a/composables/settings/definition.ts b/composables/settings/definition.ts
index 820a1b95..269df245 100644
--- a/composables/settings/definition.ts
+++ b/composables/settings/definition.ts
@@ -18,6 +18,7 @@ export interface PreferencesSettings {
hideAccountHoverCard: boolean
grayscaleMode: boolean
enableAutoplay: boolean
+ enableDataSaving: boolean
enablePinchToZoom: boolean
experimentalVirtualScroller: boolean
experimentalGitHubCards: boolean
@@ -77,6 +78,7 @@ export const DEFAULT__PREFERENCES_SETTINGS: PreferencesSettings = {
hideAccountHoverCard: false,
grayscaleMode: false,
enableAutoplay: true,
+ enableDataSaving: false,
enablePinchToZoom: false,
experimentalVirtualScroller: true,
experimentalGitHubCards: true,
diff --git a/composables/settings/storage.ts b/composables/settings/storage.ts
index 959895d6..a1a543d7 100644
--- a/composables/settings/storage.ts
+++ b/composables/settings/storage.ts
@@ -33,7 +33,12 @@ export function usePreferences(name: T): Re
}
export function getPreferences(userSettings: UserSettings, name: T): PreferencesSettings[T] {
- return userSettings?.preferences?.[name] ?? DEFAULT__PREFERENCES_SETTINGS[name]
+ const preference = userSettings?.preferences?.[name] ?? DEFAULT__PREFERENCES_SETTINGS[name]
+
+ if (name === 'enableAutoplay')
+ return getPreferences(userSettings, 'enableDataSaving') ? false : preference
+
+ return preference
}
export function togglePreferences(key: keyof PreferencesSettings) {
diff --git a/locales/en.json b/locales/en.json
index c3a3b6cc..199db495 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -402,6 +402,8 @@
"notifications_settings": "Notifications",
"preferences": {
"enable_autoplay": "Enable Autoplay",
+ "enable_data_saving": "Enable data saving",
+ "enable_data_saving_description": "Save data by preventing attachments from automatically loading.",
"enable_pinch_to_zoom": "Enable pinch to zoom",
"github_cards": "GitHub Cards",
"grayscale_mode": "Grayscale mode",
diff --git a/pages/settings/preferences/index.vue b/pages/settings/preferences/index.vue
index 89be61df..f20819c6 100644
--- a/pages/settings/preferences/index.vue
+++ b/pages/settings/preferences/index.vue
@@ -29,10 +29,20 @@ const userSettings = useUserSettings()
{{ $t('settings.preferences.enable_autoplay') }}
+
+ {{ $t("settings.preferences.enable_data_saving") }}
+
+ {{ $t("settings.preferences.enable_data_saving_description") }}
+
+