about summary refs log tree commit diff
path: root/src/state/models/ui/preferences.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/ui/preferences.ts')
-rw-r--r--src/state/models/ui/preferences.ts25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/state/models/ui/preferences.ts b/src/state/models/ui/preferences.ts
index 6ca19b4b7..7714d65df 100644
--- a/src/state/models/ui/preferences.ts
+++ b/src/state/models/ui/preferences.ts
@@ -194,7 +194,7 @@ export class PreferencesModel {
   /**
    * This function fetches preferences and sets defaults for missing items.
    */
-  async sync({clearCache}: {clearCache?: boolean} = {}) {
+  async sync() {
     await this.lock.acquireAsync()
     try {
       // fetch preferences
@@ -252,8 +252,6 @@ export class PreferencesModel {
     } finally {
       this.lock.release()
     }
-
-    await this.rootStore.me.savedFeeds.updateCache(clearCache)
   }
 
   async syncLegacyPreferences() {
@@ -286,6 +284,9 @@ export class PreferencesModel {
     }
   }
 
+  // languages
+  // =
+
   hasContentLanguage(code2: string) {
     return this.contentLanguages.includes(code2)
   }
@@ -358,6 +359,9 @@ export class PreferencesModel {
     return all.join(', ')
   }
 
+  // moderation
+  // =
+
   async setContentLabelPref(
     key: keyof LabelPreferencesModel,
     value: LabelPreference,
@@ -409,6 +413,13 @@ export class PreferencesModel {
     }
   }
 
+  // feeds
+  // =
+
+  isPinnedFeed(uri: string) {
+    return this.pinnedFeeds.includes(uri)
+  }
+
   async _optimisticUpdateSavedFeeds(
     saved: string[],
     pinned: string[],
@@ -474,6 +485,9 @@ export class PreferencesModel {
     )
   }
 
+  // other
+  // =
+
   async setBirthDate(birthDate: Date) {
     this.birthDate = birthDate
     await this.lock.acquireAsync()
@@ -602,7 +616,7 @@ export class PreferencesModel {
   }
 
   getFeedTuners(
-    feedType: 'home' | 'following' | 'author' | 'custom' | 'likes',
+    feedType: 'home' | 'following' | 'author' | 'custom' | 'list' | 'likes',
   ) {
     if (feedType === 'custom') {
       return [
@@ -610,6 +624,9 @@ export class PreferencesModel {
         FeedTuner.preferredLangOnly(this.contentLanguages),
       ]
     }
+    if (feedType === 'list') {
+      return [FeedTuner.dedupReposts]
+    }
     if (feedType === 'home' || feedType === 'following') {
       const feedTuners = []