mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-04-10 14:11:22 -06:00
✨ work with members of list #8
This commit is contained in:
parent
ff8457b87e
commit
284a65fec1
@ -34,6 +34,20 @@ const searchAndShowBskyUsers = async ({
|
||||
removeQuery: async (arg: string) => await agent.unfollow(arg),
|
||||
})
|
||||
break
|
||||
case MESSAGE_NAMES.SEARCH_BSKY_USER_ON_LIST_MEMBERS_PAGE:
|
||||
await searchAndInsertBskyUsers({
|
||||
agent,
|
||||
btnLabel: {
|
||||
add: "Follow",
|
||||
remove: "Unfollow",
|
||||
progressive: "Following",
|
||||
},
|
||||
statusKey: VIEWER_STATE.FOLLOWING,
|
||||
userCellQueryParam: '[data-testid="UserCell"]',
|
||||
addQuery: async (arg: string) => await agent.follow(arg),
|
||||
removeQuery: async (arg: string) => await agent.unfollow(arg),
|
||||
})
|
||||
break
|
||||
case MESSAGE_NAMES.SEARCH_BSKY_USER_ON_BLOCK_PAGE:
|
||||
// TODO: If already blocked, don't show blocking state. because blocking user can't find.
|
||||
await searchAndInsertBskyUsers({
|
||||
|
@ -1,5 +1,6 @@
|
||||
export const MESSAGE_NAMES = {
|
||||
SEARCH_BSKY_USER_ON_FOLLOW_PAGE: "search_bsky_user_on_follow_page",
|
||||
SEARCH_BSKY_USER_ON_LIST_MEMBERS_PAGE: "search_bsky_user_on_list_members_page",
|
||||
SEARCH_BSKY_USER_ON_BLOCK_PAGE: "search_bsky_user_on_block_page",
|
||||
}
|
||||
|
||||
@ -11,6 +12,7 @@ export const STORAGE_KEYS = {
|
||||
|
||||
export const TARGET_URLS_REGEX = {
|
||||
FOLLOW: /^https:\/\/(twitter|x)\.com\/[^/]+\/follow/,
|
||||
LIST: /^https:\/\/(twitter|x)\.com\/[^/]+\/lists\/[^/]+\/members/,
|
||||
BLOCK: /^https:\/\/(twitter|x)\.com\/settings\/blocked/,
|
||||
} as const
|
||||
|
||||
|
@ -55,6 +55,10 @@ function IndexPopup() {
|
||||
P.when((url) => TARGET_URLS_REGEX.BLOCK.test(url)),
|
||||
() => MESSAGE_NAMES.SEARCH_BSKY_USER_ON_BLOCK_PAGE
|
||||
)
|
||||
.with(
|
||||
P.when((url) => TARGET_URLS_REGEX.LIST.test(url)),
|
||||
() => MESSAGE_NAMES.SEARCH_BSKY_USER_ON_LIST_MEMBERS_PAGE
|
||||
)
|
||||
.run()
|
||||
|
||||
setMessage(null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user