add help modal during onboarding

This commit is contained in:
m5r
2021-08-04 02:46:47 +08:00
parent e98697293a
commit d93f6fd5d5
3 changed files with 103 additions and 40 deletions

View File

@ -1,10 +1,10 @@
import { useAuthenticatedSession, useQuery } from "blitz";
import { useSession, useQuery } from "blitz";
import getCurrentCustomer from "../../customers/queries/get-current-customer";
export default function useCurrentCustomer() {
const session = useAuthenticatedSession();
const [customer] = useQuery(getCurrentCustomer, null);
const session = useSession();
const [customer] = useQuery(getCurrentCustomer, null, { enabled: Boolean(session.userId) });
return {
customer,
hasFilledTwilioCredentials: Boolean(customer && customer.accountSid && customer.authToken),