Replace all underscores in a handle, not just the first

This commit is contained in:
lowercase_donkey 2023-11-07 13:44:34 -05:00
parent ac9f505e43
commit da2cf7d26a

View File

@ -33,7 +33,7 @@ export const removeReloadEl = () => {
export const getAccountNameAndDisplayName = (userCell: Element) => {
const [avatarEl, displayNameEl] = userCell?.querySelectorAll("a")
const twAccountName = avatarEl?.getAttribute("href")?.replace("/", "")
const twAccountNameRemoveUnderscore = twAccountName.replace("_", "") // bsky does not allow underscore in handle. so remove it.
const twAccountNameRemoveUnderscore = twAccountName.replaceAll("_", "") // bsky does not allow underscores in handle, so remove them.
const twDisplayName = displayNameEl?.textContent
return { twAccountName, twDisplayName, twAccountNameRemoveUnderscore }
}