about summary refs log tree commit diff
path: root/src/state/models/feeds/custom-feed.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-08-29 22:56:13 -0700
committerPaul Frazee <pfrazee@gmail.com>2023-08-29 22:56:13 -0700
commit5e765bf1cb29d30d627552da84d02594f506af1f (patch)
tree4620266dbd31e9ec525e173bb07652ff0b804ba7 /src/state/models/feeds/custom-feed.ts
parent5d9534ca7258e6165e537b89d999a8c494501dc0 (diff)
downloadvoidsky-5e765bf1cb29d30d627552da84d02594f506af1f.tar.zst
Rework web onboarding
Diffstat (limited to 'src/state/models/feeds/custom-feed.ts')
-rw-r--r--src/state/models/feeds/custom-feed.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/state/models/feeds/custom-feed.ts b/src/state/models/feeds/custom-feed.ts
index 3c6d52755..2de4534e7 100644
--- a/src/state/models/feeds/custom-feed.ts
+++ b/src/state/models/feeds/custom-feed.ts
@@ -67,6 +67,19 @@ export class CustomFeedModel {
     }
   }
 
+  async pin() {
+    try {
+      await this.rootStore.preferences.addPinnedFeed(this.uri)
+    } catch (error) {
+      this.rootStore.log.error('Failed to pin feed', error)
+    } finally {
+      track('CustomFeed:Pin', {
+        name: this.data.displayName,
+        uri: this.uri,
+      })
+    }
+  }
+
   async unsave() {
     try {
       await this.rootStore.preferences.removeSavedFeed(this.uri)