Skip to content

Commit

Permalink
Allow discovery of names with unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
zencephalon committed Aug 21, 2024
1 parent 5569a75 commit 9840348
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/web/app/(basenames)/name/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function generateMetadata({ params }: UsernameProfileProps): Promis
}

export default async function Username({ params }: UsernameProfileProps) {
let username = await formatDefaultUsername(params.username);
let username = await formatDefaultUsername(decodeURIComponent(params.username) as BaseName);

const address = await getBasenameAddress(username);
const owner = await getBasenameOwner(username);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/utils/usernames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export const USERNAME_DOMAINS: Record<number, string> = {
};

export const formatBaseEthDomain = (name: string, chainId: number): BaseName => {
return `${name}.${USERNAME_DOMAINS[chainId]}`.toLocaleLowerCase() as BaseName;
return `${name}.${USERNAME_DOMAINS[chainId] ?? '.base.eth'}`.toLocaleLowerCase() as BaseName;
};

export const getUsernamePictureIndex = (name: string, totalOptions: number) => {
Expand Down

0 comments on commit 9840348

Please sign in to comment.