diff options
Diffstat (limited to 'src/state/models/ui/preferences.ts')
-rw-r--r-- | src/state/models/ui/preferences.ts | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/state/models/ui/preferences.ts b/src/state/models/ui/preferences.ts index 64ab4ecba..7232a7b74 100644 --- a/src/state/models/ui/preferences.ts +++ b/src/state/models/ui/preferences.ts @@ -50,9 +50,11 @@ export class PreferencesModel { pinnedFeeds: string[] = [] birthDate: Date | undefined = undefined homeFeedRepliesEnabled: boolean = true - homeFeedRepliesThreshold: number = 2 + homeFeedRepliesByFollowedOnlyEnabled: boolean = true + homeFeedRepliesThreshold: number = 0 homeFeedRepostsEnabled: boolean = true homeFeedQuotePostsEnabled: boolean = true + homeFeedMergeFeedEnabled: boolean = false requireAltTextEnabled: boolean = false // used to linearize async modifications to state @@ -78,9 +80,12 @@ export class PreferencesModel { savedFeeds: this.savedFeeds, pinnedFeeds: this.pinnedFeeds, homeFeedRepliesEnabled: this.homeFeedRepliesEnabled, + homeFeedRepliesByFollowedOnlyEnabled: + this.homeFeedRepliesByFollowedOnlyEnabled, homeFeedRepliesThreshold: this.homeFeedRepliesThreshold, homeFeedRepostsEnabled: this.homeFeedRepostsEnabled, homeFeedQuotePostsEnabled: this.homeFeedQuotePostsEnabled, + homeFeedMergeFeedEnabled: this.homeFeedMergeFeedEnabled, requireAltTextEnabled: this.requireAltTextEnabled, } } @@ -148,6 +153,14 @@ export class PreferencesModel { ) { this.homeFeedRepliesEnabled = v.homeFeedRepliesEnabled } + // check if home feed replies "followed only" are enabled in preferences, then hydrate + if ( + hasProp(v, 'homeFeedRepliesByFollowedOnlyEnabled') && + typeof v.homeFeedRepliesByFollowedOnlyEnabled === 'boolean' + ) { + this.homeFeedRepliesByFollowedOnlyEnabled = + v.homeFeedRepliesByFollowedOnlyEnabled + } // check if home feed replies threshold is enabled in preferences, then hydrate if ( hasProp(v, 'homeFeedRepliesThreshold') && @@ -169,6 +182,13 @@ export class PreferencesModel { ) { this.homeFeedQuotePostsEnabled = v.homeFeedQuotePostsEnabled } + // check if home feed mergefeed is enabled in preferences, then hydrate + if ( + hasProp(v, 'homeFeedMergeFeedEnabled') && + typeof v.homeFeedMergeFeedEnabled === 'boolean' + ) { + this.homeFeedMergeFeedEnabled = v.homeFeedMergeFeedEnabled + } // check if requiring alt text is enabled in preferences, then hydrate if ( hasProp(v, 'requireAltTextEnabled') && @@ -449,6 +469,11 @@ export class PreferencesModel { this.homeFeedRepliesEnabled = !this.homeFeedRepliesEnabled } + toggleHomeFeedRepliesByFollowedOnlyEnabled() { + this.homeFeedRepliesByFollowedOnlyEnabled = + !this.homeFeedRepliesByFollowedOnlyEnabled + } + setHomeFeedRepliesThreshold(threshold: number) { this.homeFeedRepliesThreshold = threshold } @@ -461,6 +486,10 @@ export class PreferencesModel { this.homeFeedQuotePostsEnabled = !this.homeFeedQuotePostsEnabled } + toggleHomeFeedMergeFeedEnabled() { + this.homeFeedMergeFeedEnabled = !this.homeFeedMergeFeedEnabled + } + toggleRequireAltTextEnabled() { this.requireAltTextEnabled = !this.requireAltTextEnabled } |