about summary refs log tree commit diff
path: root/src/state/models/content/feed-source.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-06 20:51:46 -0600
committerGitHub <noreply@github.com>2023-11-06 18:51:46 -0800
commit7ffbee18b578cc7f6d5eff6b7b4740eeb278d387 (patch)
treef796a32dc7ad7a4fa60c90ebe8d0805eee159167 /src/state/models/content/feed-source.ts
parenta4baf14e4b9516c3611c1d8d988603994ea8a09f (diff)
downloadvoidsky-7ffbee18b578cc7f6d5eff6b7b4740eeb278d387.tar.zst
Fix removal of old lists from saved feeds (#1823)
* Fix removal of old lists from saved feeds

* Fix saved feed removal race condition
Diffstat (limited to 'src/state/models/content/feed-source.ts')
-rw-r--r--src/state/models/content/feed-source.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/state/models/content/feed-source.ts b/src/state/models/content/feed-source.ts
index 79747d6fb..156e3be3b 100644
--- a/src/state/models/content/feed-source.ts
+++ b/src/state/models/content/feed-source.ts
@@ -142,7 +142,8 @@ export class FeedSourceModel {
   }
 
   async unsave() {
-    if (this.type !== 'feed-generator') {
+    // TODO TEMPORARY — see PRF's comment in content/list.ts togglePin
+    if (this.type !== 'feed-generator' && this.type !== 'list') {
       return
     }
     try {
@@ -179,7 +180,13 @@ export class FeedSourceModel {
         name: this.displayName,
         uri: this.uri,
       })
-      return this.rootStore.preferences.removePinnedFeed(this.uri)
+
+      if (this.type === 'list') {
+        // TODO TEMPORARY — see PRF's comment in content/list.ts togglePin
+        return this.unsave()
+      } else {
+        return this.rootStore.preferences.removePinnedFeed(this.uri)
+      }
     }
   }