Skip to content

Commit

Permalink
fix: bioCard string not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaka-0x447f authored and Jack-Works committed Oct 25, 2019
1 parent 53015e3 commit dd3a587
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/social-network-provider/twitter.com/ui/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const taskPasteIntoBio = async (text: string) => {
.evaluate()!
.click()
} catch {
prompt(geti18nString('automation_request_click_edit_bio_button'))
alert(geti18nString('automation_request_click_edit_bio_button'))
}
await sleep(800)
try {
Expand Down
9 changes: 7 additions & 2 deletions src/social-network-provider/twitter.com/utils/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ const querySelectorAll = <T extends HTMLElement>(selector: string) => {

export const rootSelector = () => querySelector<HTMLElement>('body')

export const bioQueryString = '[href*="header_photo"] + div [data-testid="UserDescription"]'
export const bioQueryString = '[href*="header_photo"] + div [data-testid="UserDescription"]' // TODO: this is invalid

export const bioCard = () =>
querySelector('[href*="photo"]')
.map(x => x.parentElement!.parentElement)
.querySelector('[data-testid="UserDescription"]')
.map(x => x.parentElement!.parentElement)

export const bioCard = () => querySelector('[href*="header_photo"] + div')
export const postViewMain = () =>
querySelector<HTMLElement>('[role="progressbar"] + div + div > div > div > div:first-of-type')

Expand Down
1 change: 0 additions & 1 deletion src/social-network-provider/twitter.com/utils/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Services from '../../../extension/service'
* @link https://help.twitter.com/en/managing-your-account/twitter-username-rules
*/
export const usernameValidator: SocialNetworkWorkerAndUI['isValidUsername'] = (name: string) => {
console.log(name)
for (const v of [/(twitter|admin)/i, /.{16,}/, /[^A-Za-z0-9_]/]) {
if (!isNull(v.exec(name))) {
return false
Expand Down

0 comments on commit dd3a587

Please sign in to comment.