mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-04-17 17:22:23 -06:00
✨ support handle name in dash
This commit is contained in:
parent
dc6017c068
commit
f7e2c58c72
@ -4,6 +4,7 @@ import { BSKY_USER_MATCH_TYPE } from "./constants";
|
|||||||
type Names = {
|
type Names = {
|
||||||
accountName: string;
|
accountName: string;
|
||||||
accountNameRemoveUnderscore: string;
|
accountNameRemoveUnderscore: string;
|
||||||
|
accountNameReplaceUnderscore: string;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -36,7 +37,8 @@ export const isSimilarUser = (
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
lowerCaseNames.accountName === bskyHandle ||
|
lowerCaseNames.accountName === bskyHandle ||
|
||||||
lowerCaseNames.accountNameRemoveUnderscore === bskyHandle
|
lowerCaseNames.accountNameRemoveUnderscore === bskyHandle ||
|
||||||
|
lowerCaseNames.accountNameReplaceUnderscore === bskyHandle
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
isSimilar: true,
|
isSimilar: true,
|
||||||
|
@ -23,6 +23,7 @@ export const getAccountNameAndDisplayName = (userCell: Element) => {
|
|||||||
const [avatarEl, displayNameEl] = userCell.querySelectorAll("a");
|
const [avatarEl, displayNameEl] = userCell.querySelectorAll("a");
|
||||||
const twAccountName = avatarEl?.getAttribute("href")?.replace("/", "");
|
const twAccountName = avatarEl?.getAttribute("href")?.replace("/", "");
|
||||||
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 twDisplayName = displayNameEl?.textContent;
|
const twDisplayName = displayNameEl?.textContent;
|
||||||
return { twAccountName, twDisplayName, twAccountNameRemoveUnderscore };
|
return { twAccountName, twDisplayName, twAccountNameRemoveUnderscore, twAccountNameReplaceUnderscore };
|
||||||
};
|
};
|
||||||
|
@ -12,6 +12,7 @@ export const searchBskyUser = async ({
|
|||||||
}) => {
|
}) => {
|
||||||
const searchTerms = [
|
const searchTerms = [
|
||||||
userData.twAccountNameRemoveUnderscore,
|
userData.twAccountNameRemoveUnderscore,
|
||||||
|
userData.twAccountNameReplaceUnderscore,
|
||||||
userData.twDisplayName,
|
userData.twDisplayName,
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ export const searchBskyUser = async ({
|
|||||||
{
|
{
|
||||||
accountName: userData.twAccountName,
|
accountName: userData.twAccountName,
|
||||||
accountNameRemoveUnderscore: userData.twAccountNameRemoveUnderscore,
|
accountNameRemoveUnderscore: userData.twAccountNameRemoveUnderscore,
|
||||||
|
accountNameReplaceUnderscore: userData.twAccountNameReplaceUnderscore,
|
||||||
displayName: userData.twDisplayName,
|
displayName: userData.twDisplayName,
|
||||||
},
|
},
|
||||||
searchResult,
|
searchResult,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user