mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-04-17 17:22:23 -06:00
chore: fix lint
This commit is contained in:
parent
455a01dd14
commit
7e77fc76ff
@ -1,7 +1,7 @@
|
|||||||
import type { PlasmoMessaging } from "@plasmohq/messaging";
|
|
||||||
import { BskyClient } from "../../lib/bskyClient";
|
|
||||||
import { AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE } from "~lib/constants";
|
|
||||||
import { ComAtprotoServerCreateSession } from "@atproto/api";
|
import { ComAtprotoServerCreateSession } from "@atproto/api";
|
||||||
|
import type { PlasmoMessaging } from "@plasmohq/messaging";
|
||||||
|
import { AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE } from "~lib/constants";
|
||||||
|
import { BskyClient } from "../../lib/bskyClient";
|
||||||
|
|
||||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||||
const { identifier, password, authFactorToken } = req.body;
|
const { identifier, password, authFactorToken } = req.body;
|
||||||
@ -17,7 +17,9 @@ const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
|||||||
session: agent.session,
|
session: agent.session,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof ComAtprotoServerCreateSession.AuthFactorTokenRequiredError) {
|
if (
|
||||||
|
e instanceof ComAtprotoServerCreateSession.AuthFactorTokenRequiredError
|
||||||
|
) {
|
||||||
res.send({
|
res.send({
|
||||||
error: {
|
error: {
|
||||||
message: AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE,
|
message: AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE,
|
||||||
|
@ -74,4 +74,5 @@ export const MATCH_TYPE_LABEL_AND_COLOR = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE = "AuthFactorTokenRequiredError";
|
export const AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE =
|
||||||
|
"AuthFactorTokenRequiredError";
|
||||||
|
@ -25,5 +25,10 @@ export const getAccountNameAndDisplayName = (userCell: Element) => {
|
|||||||
const twAccountNameRemoveUnderscore = twAccountName.replaceAll("_", ""); // bsky does not allow underscores in handle, so remove them.
|
const twAccountNameRemoveUnderscore = twAccountName.replaceAll("_", ""); // bsky does not allow underscores in handle, so remove them.
|
||||||
const twAccountNameReplaceUnderscore = twAccountName.replaceAll("_", "-");
|
const twAccountNameReplaceUnderscore = twAccountName.replaceAll("_", "-");
|
||||||
const twDisplayName = displayNameEl?.textContent;
|
const twDisplayName = displayNameEl?.textContent;
|
||||||
return { twAccountName, twDisplayName, twAccountNameRemoveUnderscore, twAccountNameReplaceUnderscore };
|
return {
|
||||||
|
twAccountName,
|
||||||
|
twDisplayName,
|
||||||
|
twAccountNameRemoveUnderscore,
|
||||||
|
twAccountNameReplaceUnderscore,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -33,7 +33,8 @@ export const searchBskyUser = async ({
|
|||||||
{
|
{
|
||||||
accountName: userData.twAccountName,
|
accountName: userData.twAccountName,
|
||||||
accountNameRemoveUnderscore: userData.twAccountNameRemoveUnderscore,
|
accountNameRemoveUnderscore: userData.twAccountNameRemoveUnderscore,
|
||||||
accountNameReplaceUnderscore: userData.twAccountNameReplaceUnderscore,
|
accountNameReplaceUnderscore:
|
||||||
|
userData.twAccountNameReplaceUnderscore,
|
||||||
displayName: userData.twDisplayName,
|
displayName: userData.twDisplayName,
|
||||||
},
|
},
|
||||||
searchResult,
|
searchResult,
|
||||||
|
@ -6,12 +6,12 @@ import "./style.css";
|
|||||||
import { sendToContentScript } from "@plasmohq/messaging";
|
import { sendToContentScript } from "@plasmohq/messaging";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE,
|
||||||
MAX_RELOAD_COUNT,
|
MAX_RELOAD_COUNT,
|
||||||
MESSAGE_NAMES,
|
MESSAGE_NAMES,
|
||||||
MESSAGE_TYPE,
|
MESSAGE_TYPE,
|
||||||
STORAGE_KEYS,
|
STORAGE_KEYS,
|
||||||
TARGET_URLS_REGEX,
|
TARGET_URLS_REGEX,
|
||||||
AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE,
|
|
||||||
} from "~lib/constants";
|
} from "~lib/constants";
|
||||||
|
|
||||||
function IndexPopup() {
|
function IndexPopup() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user