diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-09-23 09:47:21 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-09-23 09:47:21 -0500 |
commit | a8c8286b88eae3e7db23555be90cb9673361be20 (patch) | |
tree | 34a7e50e776a4c2feae601f7aa08eb312da5c708 /src/state/models/post-thread-view.ts | |
parent | aabde2b401e725090232f203f23152ee1d50d566 (diff) | |
download | voidsky-a8c8286b88eae3e7db23555be90cb9673361be20.tar.zst |
Implement unfollow, unlike, unrepost
Diffstat (limited to 'src/state/models/post-thread-view.ts')
-rw-r--r-- | src/state/models/post-thread-view.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/state/models/post-thread-view.ts b/src/state/models/post-thread-view.ts index ce72201f5..fab0eb895 100644 --- a/src/state/models/post-thread-view.ts +++ b/src/state/models/post-thread-view.ts @@ -95,13 +95,17 @@ export class PostThreadViewPostModel implements GetPostThread.Post { async toggleLike() { if (this.myState.like) { - await apilib.unlike(this.rootStore.api, 'alice.test', this.uri) + await apilib.unlike(this.rootStore.api, this.myState.like) runInAction(() => { this.likeCount-- this.myState.like = undefined }) } else { - const res = await apilib.like(this.rootStore.api, 'alice.test', this.uri) + const res = await apilib.like( + this.rootStore.api, + 'did:test:alice', + this.uri, + ) runInAction(() => { this.likeCount++ this.myState.like = res.uri @@ -111,7 +115,7 @@ export class PostThreadViewPostModel implements GetPostThread.Post { async toggleRepost() { if (this.myState.repost) { - await apilib.unrepost(this.rootStore.api, 'alice.test', this.uri) + await apilib.unrepost(this.rootStore.api, this.myState.repost) runInAction(() => { this.repostCount-- this.myState.repost = undefined @@ -119,7 +123,7 @@ export class PostThreadViewPostModel implements GetPostThread.Post { } else { const res = await apilib.repost( this.rootStore.api, - 'alice.test', + 'did:test:alice', this.uri, ) runInAction(() => { |