about summary refs log tree commit diff
path: root/src/state/models/feeds/algo/algo-item.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/feeds/algo/algo-item.ts')
-rw-r--r--src/state/models/feeds/algo/algo-item.ts28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/state/models/feeds/algo/algo-item.ts b/src/state/models/feeds/algo/algo-item.ts
index 39bc760ac..8291b6d86 100644
--- a/src/state/models/feeds/algo/algo-item.ts
+++ b/src/state/models/feeds/algo/algo-item.ts
@@ -67,30 +67,12 @@ export class AlgoItemModel {
     }
   }
 
-  // public apis
-  // =
-  async save() {
-    try {
-      this.toggleSaved = true
-      await this.rootStore.agent.app.bsky.feed.saveFeed({
-        feed: this.data.uri,
-      })
-    } catch (e: any) {
-      this.rootStore.log.error('Failed to save feed', e)
-    }
-  }
-
-  async unsave() {
-    try {
-      this.toggleSaved = false
-      await this.rootStore.agent.app.bsky.feed.unsaveFeed({
-        feed: this.data.uri,
-      })
-    } catch (e: any) {
-      this.rootStore.log.error('Failed to unsanve feed', e)
-    }
+  private rewriteData(data: AppBskyFeedDefs.GeneratorView) {
+    this.data = data
   }
 
+  // public apis
+  // =
   async like() {
     try {
       const res = await this.rootStore.agent.app.bsky.feed.like.create(
@@ -151,7 +133,7 @@ export class AlgoItemModel {
     const res = await this.rootStore.agent.app.bsky.feed.getFeedGenerator({
       feed: this.data.uri,
     })
-    this.data = res.data.view
+    this.rewriteData(res.data.view)
   }
 
   serialize() {