Move require alt-text to new persistence + context (#1839)

This commit is contained in:
Paul Frazee 2023-11-08 08:52:01 -08:00 committed by GitHub
parent 2acc88e78d
commit 3a211017d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 25 deletions

View file

@ -83,7 +83,6 @@ export class PreferencesModel {
prioritizeFollowedUsers: true,
lab_treeViewEnabled: false, // experimental
}
requireAltTextEnabled: boolean = false
// used to help with transitions from device-stored to server-stored preferences
legacyPreferences: LegacyPreferences | undefined
@ -111,7 +110,6 @@ export class PreferencesModel {
contentLabels: this.contentLabels,
savedFeeds: this.savedFeeds,
pinnedFeeds: this.pinnedFeeds,
requireAltTextEnabled: this.requireAltTextEnabled,
}
}
@ -180,13 +178,6 @@ export class PreferencesModel {
) {
this.pinnedFeeds = v.pinnedFeeds
}
// check if requiring alt text is enabled in preferences, then hydrate
if (
hasProp(v, 'requireAltTextEnabled') &&
typeof v.requireAltTextEnabled === 'boolean'
) {
this.requireAltTextEnabled = v.requireAltTextEnabled
}
// grab legacy values
this.legacyPreferences = getLegacyPreferences(v)
}
@ -608,10 +599,6 @@ export class PreferencesModel {
}
}
toggleRequireAltTextEnabled() {
this.requireAltTextEnabled = !this.requireAltTextEnabled
}
setPrimaryLanguage(lang: string) {
this.primaryLanguage = lang
}