mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-04-09 13:41:23 -06:00
Merge pull request #54 from mozzius/samuel/async-resumesession
await resumeSession call
This commit is contained in:
commit
7572736da7
@ -3,7 +3,7 @@ import { BskyClient } from "~lib/bskyClient";
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { session, subjectDid } = req.body;
|
||||
const client = BskyClient.createAgentFromSession(session);
|
||||
const client = await BskyClient.createAgentFromSession(session);
|
||||
|
||||
try {
|
||||
res.send({
|
||||
|
@ -3,7 +3,7 @@ import { BskyClient } from "~lib/bskyClient";
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { session, subjectDid } = req.body;
|
||||
const client = BskyClient.createAgentFromSession(session);
|
||||
const client = await BskyClient.createAgentFromSession(session);
|
||||
|
||||
try {
|
||||
res.send({
|
||||
|
@ -3,7 +3,7 @@ import { BskyClient } from "~lib/bskyClient";
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { session, term, limit } = req.body;
|
||||
const client = BskyClient.createAgentFromSession(session);
|
||||
const client = await BskyClient.createAgentFromSession(session);
|
||||
|
||||
try {
|
||||
res.send({
|
||||
|
@ -3,7 +3,7 @@ import { BskyClient } from "~lib/bskyClient";
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { session, blockUri } = req.body;
|
||||
const client = BskyClient.createAgentFromSession(session);
|
||||
const client = await BskyClient.createAgentFromSession(session);
|
||||
|
||||
try {
|
||||
res.send({
|
||||
|
@ -3,7 +3,7 @@ import { BskyClient } from "~lib/bskyClient";
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const { session, followUri } = req.body;
|
||||
const client = BskyClient.createAgentFromSession(session);
|
||||
const client = await BskyClient.createAgentFromSession(session);
|
||||
|
||||
try {
|
||||
res.send({
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user