fix for linter

This commit is contained in:
Doug Flowers 2024-11-19 18:22:03 -06:00
parent 409cd355b5
commit 8f9993285a
8 changed files with 28 additions and 20 deletions

View File

@ -5,7 +5,9 @@ import { STORAGE_KEYS } from "~lib/constants";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
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];
if (!session || !session.did) {

View File

@ -67,7 +67,10 @@ const App = () => {
const stopAndShowDetectedUsers = async () => {
stopRetrieveLoop();
await chrome.storage.local.set({ users: JSON.stringify(users), listName: listName });
await chrome.storage.local.set({
users: JSON.stringify(users),
listName: listName,
});
openOptionPage();
};

View File

@ -124,14 +124,14 @@ export class BskyClient {
}) => {
const result = await this.agent.com.atproto.repo.createRecord({
repo: this.me.did,
collection: 'app.bsky.graph.list',
collection: "app.bsky.graph.list",
record: {
$type: 'app.bsky.graph.list',
purpose: 'app.bsky.graph.defs#curatelist',
$type: "app.bsky.graph.list",
purpose: "app.bsky.graph.defs#curatelist",
name,
description,
createdAt: new Date().toISOString()
}
createdAt: new Date().toISOString(),
},
});
return result.data.uri;
};
@ -145,13 +145,13 @@ export class BskyClient {
}) => {
return await this.agent.com.atproto.repo.createRecord({
repo: this.me.did,
collection: 'app.bsky.graph.listitem',
collection: "app.bsky.graph.listitem",
record: {
$type: 'app.bsky.graph.listitem',
$type: "app.bsky.graph.listitem",
subject: userDid,
list: listUri,
createdAt: new Date().toISOString()
}
createdAt: new Date().toISOString(),
},
});
};

View File

@ -157,10 +157,7 @@ const Sidebar = ({
</svg>
<p className="text-xl font-bold">Action</p>
</div>
<AsyncButton
onClick={actionAll}
label={getActionLabel()}
/>
<AsyncButton onClick={actionAll} label={getActionLabel()} />
<p className="text-xs">
User detection is not perfect and may include false positives.
</p>

View File

@ -1,8 +1,8 @@
import React from "react";
import { match } from "ts-pattern";
import type { BskyUser } from "~types";
import { ACTION_MODE, MATCH_TYPE_LABEL_AND_COLOR } from "../constants";
import AvatarFallbackSvg from "./Icons/AvatarFallbackSvg";
import type { BskyUser } from "~types";
export type Props = {
user: BskyUser;

View File

@ -25,7 +25,8 @@ export const ACTION_MODE = {
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_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,
};

View File

@ -130,7 +130,7 @@ export const useBskyUserManager = () => {
let actionCount = 0;
if (actionMode === ACTION_MODE.IMPORT_LIST) {
const userDids = filteredUsers.map(user => user.did);
const userDids = filteredUsers.map((user) => user.did);
await chrome.runtime.sendMessage({
name: "createListAndAddUsers",
body: {

View File

@ -9,7 +9,9 @@ import { XService } from "~lib/services/x";
import type { BskyUser, CrawledUserInfo } from "~types";
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) {
return listNameElement.textContent.trim();
}
@ -114,7 +116,10 @@ export const useRetrieveBskyUsers = () => {
);
React.useEffect(() => {
chrome.storage.local.set({ users: JSON.stringify(users), listName: listName });
chrome.storage.local.set({
users: JSON.stringify(users),
listName: listName
});
}, [users, listName]);
const stopRetrieveLoop = React.useCallback(() => {