Update to the latest APIs

This commit is contained in:
Paul Frazee 2022-11-04 17:39:54 -05:00
parent 8ae6e67eea
commit f333a90fab
165 changed files with 2963 additions and 4747 deletions

View file

@ -3,7 +3,7 @@ import {RootStoreModel} from './root-store'
export class MeModel {
did?: string
name?: string
handle?: string
displayName?: string
description?: string
notificationCount: number = 0
@ -14,7 +14,7 @@ export class MeModel {
clear() {
this.did = undefined
this.name = undefined
this.handle = undefined
this.displayName = undefined
this.description = undefined
this.notificationCount = 0
@ -23,9 +23,9 @@ export class MeModel {
async load() {
const sess = this.rootStore.session
if (sess.isAuthed && sess.data) {
this.did = sess.data.userdid || ''
this.name = sess.data.username
const profile = await this.rootStore.api.app.bsky.getProfile({
this.did = sess.data.did || ''
this.handle = sess.data.handle
const profile = await this.rootStore.api.app.bsky.actor.getProfile({
user: this.did,
})
runInAction(() => {
@ -43,7 +43,7 @@ export class MeModel {
}
async fetchStateUpdate() {
const res = await this.rootStore.api.app.bsky.getNotificationCount({})
const res = await this.rootStore.api.app.bsky.notification.getCount()
runInAction(() => {
this.notificationCount = res.data.count
})