async resumeSession

This commit is contained in:
Samuel Newman
2024-10-17 17:14:12 +03:00
parent 1bd4b07c38
commit b86216f7c2
6 changed files with 9 additions and 7 deletions

View File

@@ -27,12 +27,14 @@ export class BskyClient {
});
}
public static createAgentFromSession(session: AtpSessionData): BskyClient {
public static async createAgentFromSession(
session: AtpSessionData,
): Promise<BskyClient> {
if (clientCache.has(session.did)) {
return clientCache.get(session.did);
}
const client = new BskyClient();
client.agent.resumeSession(session);
await client.agent.resumeSession(session);
client.me = {
did: session.did,
handle: session.handle,