about summary refs log tree commit diff
path: root/src/state/models/ui/saved-feeds.ts
diff options
context:
space:
mode:
authorAnsh Nanda <anshnanda10@gmail.com>2023-05-22 20:07:40 -0700
committerAnsh Nanda <anshnanda10@gmail.com>2023-05-22 20:07:40 -0700
commit52a8879754e07c3e0aa90a40fdc27dfdc40fd450 (patch)
treee2153a156c7e8e12d4f7d23c5fa81d87eb4498be /src/state/models/ui/saved-feeds.ts
parent8a2349c55ffcff4f833c015f9b10296aa9d77738 (diff)
downloadvoidsky-52a8879754e07c3e0aa90a40fdc27dfdc40fd450.tar.zst
update pinned feed from custom feed view
Diffstat (limited to 'src/state/models/ui/saved-feeds.ts')
-rw-r--r--src/state/models/ui/saved-feeds.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/state/models/ui/saved-feeds.ts b/src/state/models/ui/saved-feeds.ts
index 0d04f9c8d..244e75898 100644
--- a/src/state/models/ui/saved-feeds.ts
+++ b/src/state/models/ui/saved-feeds.ts
@@ -129,8 +129,14 @@ export class SavedFeedsModel {
     )
   }
 
-  isPinned(feed: CustomFeedModel) {
-    return this.rootStore.preferences.pinnedFeeds.includes(feed.uri)
+  isPinned(feedOrUri: CustomFeedModel | string) {
+    let uri: string
+    if (typeof feedOrUri === 'string') {
+      uri = feedOrUri
+    } else {
+      uri = feedOrUri.uri
+    }
+    return this.rootStore.preferences.pinnedFeeds.includes(uri)
   }
 
   async movePinnedFeed(item: CustomFeedModel, direction: 'up' | 'down') {