diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-16 12:53:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-16 12:53:43 -0800 |
commit | 54faa7e176ed2f8644ef4941c8a65522107a84c1 (patch) | |
tree | 336d69d37809041dcc38a932975fcf438ac60dfd /src/lib/api | |
parent | e637798e05ba3bfc1c78be1b0f70e8b0ac22554d (diff) | |
download | voidsky-54faa7e176ed2f8644ef4941c8a65522107a84c1.tar.zst |
Remove deprecated models and mobx usage (react-query refactor) (#1934)
* Update login page to use service query * Update modal to use session instead of store * Move image sizes cache off store * Update settings to no longer use store * Update link-meta fetch to use agent instead of rootstore * Remove deprecated resolveName() * Delete deprecated link-metas cache * Delete deprecated posts cache * Delete all remaining mobx models, including the root store * Strip out unused mobx observer wrappers
Diffstat (limited to 'src/lib/api')
-rw-r--r-- | src/lib/api/index.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index 92620c459..a78abcacd 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -10,7 +10,6 @@ import { RichText, } from '@atproto/api' import {AtUri} from '@atproto/api' -import {RootStoreModel} from 'state/models/root-store' import {isNetworkError} from 'lib/strings/errors' import {LinkMeta} from '../link-meta/link-meta' import {isWeb} from 'platform/detection' @@ -26,33 +25,6 @@ export interface ExternalEmbedDraft { localThumb?: ImageModel } -export async function resolveName(store: RootStoreModel, didOrHandle: string) { - if (!didOrHandle) { - throw new Error('Invalid handle: ""') - } - if (didOrHandle.startsWith('did:')) { - return didOrHandle - } - - // we run the resolution always to ensure freshness - const promise = store.agent - .resolveHandle({ - handle: didOrHandle, - }) - .then(res => { - store.handleResolutions.cache.set(didOrHandle, res.data.did) - return res.data.did - }) - - // but we can return immediately if it's cached - const cached = store.handleResolutions.cache.get(didOrHandle) - if (cached) { - return cached - } - - return promise -} - export async function uploadBlob( agent: BskyAgent, blob: string, |