From 8a4239d1539f149e5229d469ad1bb251871d7661 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 19 Jun 2023 12:10:29 -0500 Subject: [PATCH] utils/accounts: pick only needed fields from type --- app/soapbox/utils/accounts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/utils/accounts.ts b/app/soapbox/utils/accounts.ts index ef7c446a5..95ea333ae 100644 --- a/app/soapbox/utils/accounts.ts +++ b/app/soapbox/utils/accounts.ts @@ -1,7 +1,7 @@ import type { Account } from 'soapbox/schemas'; import type { Account as AccountEntity } from 'soapbox/types/entities'; -const getDomainFromURL = (account: AccountEntity): string => { +const getDomainFromURL = (account: Pick): string => { try { const url = account.url; return new URL(url).host; @@ -10,7 +10,7 @@ const getDomainFromURL = (account: AccountEntity): string => { } }; -export const getDomain = (account: AccountEntity): string => { +export const getDomain = (account: Pick): string => { const domain = account.acct.split('@')[1]; return domain ? domain : getDomainFromURL(account); };