2021-08-01 07:40:18 +00:00
|
|
|
import { useQuery } from "blitz";
|
|
|
|
import getConversationsQuery from "../queries/get-conversations";
|
|
|
|
|
|
|
|
export default function useKnownRecipients() {
|
|
|
|
return useQuery(
|
|
|
|
getConversationsQuery,
|
|
|
|
{},
|
|
|
|
{
|
|
|
|
select(conversations) {
|
2021-09-24 23:12:16 +00:00
|
|
|
if (!conversations) {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2021-08-01 07:40:18 +00:00
|
|
|
return Object.keys(conversations);
|
|
|
|
},
|
2021-08-01 12:04:04 +00:00
|
|
|
},
|
2021-08-01 07:40:18 +00:00
|
|
|
);
|
|
|
|
}
|