diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-08 13:45:23 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-12-08 13:45:23 -0600 |
commit | 539bf5d35069a654fb31b1ff636358fe28793c06 (patch) | |
tree | 89672e39e506ff3898aa1e4b9a306b6b31d89b47 /src/state/models/votes-view.ts | |
parent | 273e6d29734153e86a4b42b7e81d05fe5627f649 (diff) | |
download | voidsky-539bf5d35069a654fb31b1ff636358fe28793c06.tar.zst |
Add avatar images and fix some type signatures
Diffstat (limited to 'src/state/models/votes-view.ts')
-rw-r--r-- | src/state/models/votes-view.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/state/models/votes-view.ts b/src/state/models/votes-view.ts index d70737021..6e9130e90 100644 --- a/src/state/models/votes-view.ts +++ b/src/state/models/votes-view.ts @@ -1,11 +1,10 @@ import {makeAutoObservable, runInAction} from 'mobx' import {AtUri} from '../../third-party/uri' import * as GetVotes from '../../third-party/api/src/client/types/app/bsky/feed/getVotes' +import * as ActorRef from '../../third-party/api/src/client/types/app/bsky/actor/ref' import {RootStoreModel} from './root-store' -type VoteItem = GetVotes.OutputSchema['votes'][number] - -export class VotesViewItemModel implements VoteItem { +export class VotesViewItemModel implements GetVotes.Vote { // ui state _reactKey: string = '' @@ -13,9 +12,13 @@ export class VotesViewItemModel implements VoteItem { direction: 'up' | 'down' = 'up' indexedAt: string = '' createdAt: string = '' - actor: GetVotes.Actor = {did: '', handle: ''} + actor: ActorRef.WithInfo = { + did: '', + handle: '', + declaration: {cid: '', actorType: ''}, + } - constructor(reactKey: string, v: VoteItem) { + constructor(reactKey: string, v: GetVotes.Vote) { makeAutoObservable(this) this._reactKey = reactKey Object.assign(this, v) @@ -127,7 +130,7 @@ export class VotesViewModel { } } - private _append(keyId: number, item: VoteItem) { + private _append(keyId: number, item: GetVotes.Vote) { this.votes.push(new VotesViewItemModel(`item-${keyId}`, item)) } } |