diff --git a/src/screens/Tabs/Shared/Account.tsx b/src/screens/Tabs/Shared/Account.tsx index 758071c0..635fcddb 100644 --- a/src/screens/Tabs/Shared/Account.tsx +++ b/src/screens/Tabs/Shared/Account.tsx @@ -81,7 +81,7 @@ const TabSharedAccount: React.FC ) } }) - }, []) + }, [mAccount]) const { data } = useAccountQuery({ id: account.id }) diff --git a/src/screens/Tabs/Shared/AccountInLists.tsx b/src/screens/Tabs/Shared/AccountInLists.tsx index 8628c41c..4e7d8041 100644 --- a/src/screens/Tabs/Shared/AccountInLists.tsx +++ b/src/screens/Tabs/Shared/AccountInLists.tsx @@ -48,8 +48,8 @@ const TabSharedAccountInLists: React.FC< id: 'out', title: t('shared.accountInLists.notInLists'), data: - listsQuery?.data?.filter( - ({ id }) => !accountInListsQuery?.data?.filter(d => d.id === id)?.length + listsQuery.data?.filter( + ({ id }) => accountInListsQuery.data?.filter(d => d.id !== id).length ) || [] } ] diff --git a/src/utils/queryHooks/account.ts b/src/utils/queryHooks/account.ts index 7187b437..565fa71b 100644 --- a/src/utils/queryHooks/account.ts +++ b/src/utils/queryHooks/account.ts @@ -27,7 +27,9 @@ const useAccountQuery = ({ export type QueryKeyAccountInLists = ['AccountInLists', { id: Mastodon.Account['id'] }] -const accountInListsQueryFunction = ({ queryKey }: QueryFunctionContext) => { +const accountInListsQueryFunction = ({ + queryKey +}: QueryFunctionContext) => { const { id } = queryKey[1] return apiInstance({ @@ -42,7 +44,7 @@ const useAccountInListsQuery = ({ }: QueryKeyAccount[1] & { options?: UseQueryOptions }) => { - const queryKey: QueryKeyAccount = ['Account', { ...queryKeyParams }] + const queryKey: QueryKeyAccountInLists = ['AccountInLists', { ...queryKeyParams }] return useQuery(queryKey, accountInListsQueryFunction, options) }