shellphone.app/app/core/hooks/use-current-phone-number.ts

12 lines
403 B
TypeScript
Raw Normal View History

2021-08-05 17:07:15 +00:00
import { useQuery } from "blitz";
import getCurrentPhoneNumber from "app/phone-numbers/queries/get-current-phone-number";
2021-08-05 17:07:15 +00:00
import useCurrentUser from "./use-current-user";
export default function useUserPhoneNumber() {
const { hasFilledTwilioCredentials } = useCurrentUser();
const [phoneNumber] = useQuery(getCurrentPhoneNumber, {}, { enabled: hasFilledTwilioCredentials });
return phoneNumber;
}