1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
xmflsct
2022-12-23 20:02:44 +01:00
parent 3594500b3e
commit 64b367a247
3 changed files with 15 additions and 8 deletions

View File

@ -8,6 +8,7 @@ import {
} from '@tanstack/react-query'
import apiGeneral from '@api/general'
import { PagedResponse } from '@api/helpers'
import { getHost } from '@helpers/urlMatcher'
export type QueryKeyUsers = ['Users', TabSharedStackParamList['Tab-Shared-Users']]
@ -38,9 +39,7 @@ const queryFunction = async ({
let res: PagedResponse<Mastodon.Account[]>
try {
const domain = page.account.url.match(
/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/i
)?.[1]
const domain = getHost(page.account.url)
if (!domain?.length) {
throw new Error()
}