about summary refs log tree commit diff
path: root/src/state/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models')
-rw-r--r--src/state/models/notifications-view.ts10
-rw-r--r--src/state/models/root-store.ts16
2 files changed, 14 insertions, 12 deletions
diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts
index dc372ab55..0ee5fd81b 100644
--- a/src/state/models/notifications-view.ts
+++ b/src/state/models/notifications-view.ts
@@ -40,29 +40,27 @@ export class NotificationsViewItemModel
 
   get isLike() {
     return (
-      hasProp(this.record, '$type') &&
-      this.record.$type === 'blueskyweb.xyz:Like'
+      hasProp(this.record, '$type') && this.record.$type === 'todo.social.like'
     )
   }
 
   get isRepost() {
     return (
       hasProp(this.record, '$type') &&
-      this.record.$type === 'blueskyweb.xyz:Repost'
+      this.record.$type === 'todo.social.repost'
     )
   }
 
   get isReply() {
     return (
-      hasProp(this.record, '$type') &&
-      this.record.$type === 'blueskyweb.xyz:Post'
+      hasProp(this.record, '$type') && this.record.$type === 'todo.social.post'
     )
   }
 
   get isFollow() {
     return (
       hasProp(this.record, '$type') &&
-      this.record.$type === 'blueskyweb.xyz:Follow'
+      this.record.$type === 'todo.social.follow'
     )
   }
 
diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts
index adbcb2389..ea3da1859 100644
--- a/src/state/models/root-store.ts
+++ b/src/state/models/root-store.ts
@@ -3,7 +3,8 @@
  */
 
 import {makeAutoObservable} from 'mobx'
-import AdxApi, {ServiceClient} from '../../third-party/api'
+import AdxApi from '../../third-party/api'
+import {ServiceClient} from '../../third-party/api/src/index'
 import {createContext, useContext} from 'react'
 import {isObj, hasProp} from '../lib/type-guards'
 import {SessionModel} from './session'
@@ -27,11 +28,14 @@ export class RootStoreModel {
   }
 
   async resolveName(didOrName: string) {
-    throw new Error('TODO')
-    return ''
-    // const userDb = this.api.mockDb.getUser(didOrName)
-    // if (!userDb) throw new Error(`User not found: ${didOrName}`)
-    // return userDb.did
+    if (!didOrName) {
+      throw new Error('Invalid name: ""')
+    }
+    if (didOrName.startsWith('did:')) {
+      return didOrName
+    }
+    const res = await this.api.todo.adx.resolveName({name: didOrName})
+    return res.data.did
   }
 
   serialize(): unknown {