shellphone.app/app/messages/hooks/use-known-recipients.ts
2021-09-25 07:12:16 +08:00

19 lines
333 B
TypeScript

import { useQuery } from "blitz";
import getConversationsQuery from "../queries/get-conversations";
export default function useKnownRecipients() {
return useQuery(
getConversationsQuery,
{},
{
select(conversations) {
if (!conversations) {
return [];
}
return Object.keys(conversations);
},
},
);
}