diff --git a/pages/[username]/index.vue b/pages/[username]/index.vue
index 6ad22e6..0cc50c8 100644
--- a/pages/[username]/index.vue
+++ b/pages/[username]/index.vue
@@ -22,12 +22,19 @@ definePageMeta({
const route = useRoute();
const client = useClient();
-const username = (route.params.username as string).replace("@", "");
+const username = (route.params.username as string).startsWith("@")
+ ? (route.params.username as string).substring(1)
+ : (route.params.username as string);
const accounts = useAccountSearch(client, username);
watch(accounts, (newValue) => {
if (Array.isArray(newValue)) {
- if (!newValue.find((account) => account.acct === username)) {
+ if (
+ !newValue.find(
+ (account) =>
+ account.acct.toLowerCase() === username.toLowerCase(),
+ )
+ ) {
useEvent("error", {
title: "Account not found",
message: `The account @${username} does not exist.`,
@@ -37,7 +44,10 @@ watch(accounts, (newValue) => {
}
});
const account = computed(
- () => accounts.value?.find((account) => account.acct === username) ?? null,
+ () =>
+ accounts.value?.find(
+ (account) => account.acct.toLowerCase() === username.toLowerCase(),
+ ) ?? null,
);
const accountId = computed(() => account.value?.id ?? undefined);