mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-04-23 20:12:22 -06:00
fix for linter
This commit is contained in:
parent
409cd355b5
commit
8f9993285a
@ -5,7 +5,9 @@ import { STORAGE_KEYS } from "~lib/constants";
|
|||||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||||
const { name, description, userDids } = req.body;
|
const { name, description, userDids } = req.body;
|
||||||
|
|
||||||
const storage = await chrome.storage.local.get(STORAGE_KEYS.BSKY_CLIENT_SESSION);
|
const storage = await chrome.storage.local.get(
|
||||||
|
STORAGE_KEYS.BSKY_CLIENT_SESSION,
|
||||||
|
);
|
||||||
const session = storage[STORAGE_KEYS.BSKY_CLIENT_SESSION];
|
const session = storage[STORAGE_KEYS.BSKY_CLIENT_SESSION];
|
||||||
|
|
||||||
if (!session || !session.did) {
|
if (!session || !session.did) {
|
||||||
|
@ -67,7 +67,10 @@ const App = () => {
|
|||||||
|
|
||||||
const stopAndShowDetectedUsers = async () => {
|
const stopAndShowDetectedUsers = async () => {
|
||||||
stopRetrieveLoop();
|
stopRetrieveLoop();
|
||||||
await chrome.storage.local.set({ users: JSON.stringify(users), listName: listName });
|
await chrome.storage.local.set({
|
||||||
|
users: JSON.stringify(users),
|
||||||
|
listName: listName,
|
||||||
|
});
|
||||||
openOptionPage();
|
openOptionPage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -124,14 +124,14 @@ export class BskyClient {
|
|||||||
}) => {
|
}) => {
|
||||||
const result = await this.agent.com.atproto.repo.createRecord({
|
const result = await this.agent.com.atproto.repo.createRecord({
|
||||||
repo: this.me.did,
|
repo: this.me.did,
|
||||||
collection: 'app.bsky.graph.list',
|
collection: "app.bsky.graph.list",
|
||||||
record: {
|
record: {
|
||||||
$type: 'app.bsky.graph.list',
|
$type: "app.bsky.graph.list",
|
||||||
purpose: 'app.bsky.graph.defs#curatelist',
|
purpose: "app.bsky.graph.defs#curatelist",
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
createdAt: new Date().toISOString()
|
createdAt: new Date().toISOString(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
return result.data.uri;
|
return result.data.uri;
|
||||||
};
|
};
|
||||||
@ -145,13 +145,13 @@ export class BskyClient {
|
|||||||
}) => {
|
}) => {
|
||||||
return await this.agent.com.atproto.repo.createRecord({
|
return await this.agent.com.atproto.repo.createRecord({
|
||||||
repo: this.me.did,
|
repo: this.me.did,
|
||||||
collection: 'app.bsky.graph.listitem',
|
collection: "app.bsky.graph.listitem",
|
||||||
record: {
|
record: {
|
||||||
$type: 'app.bsky.graph.listitem',
|
$type: "app.bsky.graph.listitem",
|
||||||
subject: userDid,
|
subject: userDid,
|
||||||
list: listUri,
|
list: listUri,
|
||||||
createdAt: new Date().toISOString()
|
createdAt: new Date().toISOString(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -157,10 +157,7 @@ const Sidebar = ({
|
|||||||
</svg>
|
</svg>
|
||||||
<p className="text-xl font-bold">Action</p>
|
<p className="text-xl font-bold">Action</p>
|
||||||
</div>
|
</div>
|
||||||
<AsyncButton
|
<AsyncButton onClick={actionAll} label={getActionLabel()} />
|
||||||
onClick={actionAll}
|
|
||||||
label={getActionLabel()}
|
|
||||||
/>
|
|
||||||
<p className="text-xs">
|
<p className="text-xs">
|
||||||
⚠️ User detection is not perfect and may include false positives.
|
⚠️ User detection is not perfect and may include false positives.
|
||||||
</p>
|
</p>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { match } from "ts-pattern";
|
import { match } from "ts-pattern";
|
||||||
|
import type { BskyUser } from "~types";
|
||||||
import { ACTION_MODE, MATCH_TYPE_LABEL_AND_COLOR } from "../constants";
|
import { ACTION_MODE, MATCH_TYPE_LABEL_AND_COLOR } from "../constants";
|
||||||
import AvatarFallbackSvg from "./Icons/AvatarFallbackSvg";
|
import AvatarFallbackSvg from "./Icons/AvatarFallbackSvg";
|
||||||
import type { BskyUser } from "~types";
|
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
user: BskyUser;
|
user: BskyUser;
|
||||||
|
@ -25,7 +25,8 @@ export const ACTION_MODE = {
|
|||||||
|
|
||||||
export const MESSAGE_NAME_TO_ACTION_MODE_MAP = {
|
export const MESSAGE_NAME_TO_ACTION_MODE_MAP = {
|
||||||
[MESSAGE_NAMES.SEARCH_BSKY_USER_ON_FOLLOW_PAGE]: ACTION_MODE.FOLLOW,
|
[MESSAGE_NAMES.SEARCH_BSKY_USER_ON_FOLLOW_PAGE]: ACTION_MODE.FOLLOW,
|
||||||
[MESSAGE_NAMES.SEARCH_BSKY_USER_ON_LIST_MEMBERS_PAGE]: ACTION_MODE.IMPORT_LIST,
|
[MESSAGE_NAMES.SEARCH_BSKY_USER_ON_LIST_MEMBERS_PAGE]:
|
||||||
|
ACTION_MODE.IMPORT_LIST,
|
||||||
[MESSAGE_NAMES.SEARCH_BSKY_USER_ON_BLOCK_PAGE]: ACTION_MODE.BLOCK,
|
[MESSAGE_NAMES.SEARCH_BSKY_USER_ON_BLOCK_PAGE]: ACTION_MODE.BLOCK,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ export const useBskyUserManager = () => {
|
|||||||
let actionCount = 0;
|
let actionCount = 0;
|
||||||
|
|
||||||
if (actionMode === ACTION_MODE.IMPORT_LIST) {
|
if (actionMode === ACTION_MODE.IMPORT_LIST) {
|
||||||
const userDids = filteredUsers.map(user => user.did);
|
const userDids = filteredUsers.map((user) => user.did);
|
||||||
await chrome.runtime.sendMessage({
|
await chrome.runtime.sendMessage({
|
||||||
name: "createListAndAddUsers",
|
name: "createListAndAddUsers",
|
||||||
body: {
|
body: {
|
||||||
|
@ -9,7 +9,9 @@ import { XService } from "~lib/services/x";
|
|||||||
import type { BskyUser, CrawledUserInfo } from "~types";
|
import type { BskyUser, CrawledUserInfo } from "~types";
|
||||||
|
|
||||||
const scrapeListNameFromPage = (): string => {
|
const scrapeListNameFromPage = (): string => {
|
||||||
const listNameElement = document.querySelector('div[aria-label="Timeline: List"] span');
|
const listNameElement = document.querySelector(
|
||||||
|
'div[aria-label="Timeline: List"] span'
|
||||||
|
);
|
||||||
if (listNameElement) {
|
if (listNameElement) {
|
||||||
return listNameElement.textContent.trim();
|
return listNameElement.textContent.trim();
|
||||||
}
|
}
|
||||||
@ -114,7 +116,10 @@ export const useRetrieveBskyUsers = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
chrome.storage.local.set({ users: JSON.stringify(users), listName: listName });
|
chrome.storage.local.set({
|
||||||
|
users: JSON.stringify(users),
|
||||||
|
listName: listName
|
||||||
|
});
|
||||||
}, [users, listName]);
|
}, [users, listName]);
|
||||||
|
|
||||||
const stopRetrieveLoop = React.useCallback(() => {
|
const stopRetrieveLoop = React.useCallback(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user