Skip to content

Commit

Permalink
fix: small fixups (#10809)
Browse files Browse the repository at this point in the history
* fix: mf-5253 match lens domain starts with number

* fix: mf-5058 mirror just updated tag name

* fix: mf-5337 urlcat breaking change
  • Loading branch information
UncleBill committed Sep 21, 2023
1 parent b42b42b commit 833d8d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function queryInjectPoint(node: HTMLElement) {
const allANode = node.querySelectorAll(
[
// post detail header
`:scope div[href$="/${authorWallet}" i]:has(img[alt^="0x" i][decoding="async"]) > div:last-child`, // img alt is always address
`:scope [href$="/${authorWallet}" i]:has(img[alt^="0x" i][decoding="async"]) > div:last-of-type`, // img alt is always address
// collection page card footer
':scope header div:has(> span img[alt="Publisher"])',
].join(','),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function FileServiceDialog({ onClose, selectMode, selectedFileIds, compos
const OpenEntry = selectMode
? {
pathname: RoutePaths.FileSelector,
search: '?' + urlcat('', { selectedFileIds }),
search: '?' + urlcat('', { selectedFileIds: selectedFileIds?.join(',') }),
}
: RoutePaths.Browser
return [RoutePaths.Exit, OpenEntry, RoutePaths.Terms]
Expand Down
9 changes: 4 additions & 5 deletions packages/web3-providers/src/Web3/EVM/state/IdentityService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compact, first, uniqBy } from 'lodash-es'
import { compact, uniqBy } from 'lodash-es'
import type { WalletAPI } from '../../../entry-types.js'
import {
EMPTY_LIST,
Expand Down Expand Up @@ -35,7 +35,6 @@ const ADDRESS_FULL = /0x\w{40,}/i
const CROSSBELL_HANDLE_RE = /[\w.]+\.csb/gi
const LENS_RE = /[^\s()[\]]{1,256}\.lens\b/i
const LENS_URL_RE = /https?:\/\/.+\/(\w+\.lens)/
const LENS_DOMAIN_RE = /[a-z][\d_a-z]{4,25}\.lens/

const ARBID = new ARBID_API()
const ENS = new ENS_API()
Expand All @@ -53,9 +52,9 @@ function getENSNames(userId: string, nickname: string, bio: string) {
}

function getLensNames(nickname: string, bio: string, homepage: string) {
const homepageNames = homepage.match(LENS_URL_RE)
const homepageNames = homepage.match(LENS_URL_RE)?.[1]
const names = [nickname.match(LENS_RE), bio.match(LENS_RE)].map((result) => result?.[0] ?? '')
return [...names, homepageNames?.[1]].map((x) => first(x?.match(LENS_DOMAIN_RE)) ?? '').filter(Boolean)
return [...names, homepageNames].filter(Boolean) as string[]
}

function getARBIDNames(userId: string, nickname: string, bio: string) {
Expand Down Expand Up @@ -340,7 +339,7 @@ export class IdentityService extends IdentityServiceState<ChainId> {

const handle = identity.identifier?.userId
const verifiedResult = await Promise.allSettled(
identities.map(async (x) => {
uniqBy(identities, (x) => x.address.toLowerCase()).map(async (x) => {
const address = x.address.toLowerCase()
const isReliable = await Firefly.verifyTwitterHandlerByAddress(address, handle)
return isReliable ? address : null
Expand Down

0 comments on commit 833d8d9

Please sign in to comment.