get rid of onboarding requirements
This commit is contained in:
@ -19,7 +19,7 @@ export default function EmptyMessages() {
|
||||
<div className="mt-6">
|
||||
<button
|
||||
type="button"
|
||||
className="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-[#007AFF] focus:outline-none focus:ring-2 focus:ring-offset-2"
|
||||
className="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary-500 focus:outline-none focus:ring-2 focus:ring-offset-2"
|
||||
onClick={openNewMessageArea}
|
||||
>
|
||||
<IoCreateOutline className="-ml-1 mr-2 h-5 w-5" aria-hidden="true" />
|
||||
|
@ -4,14 +4,16 @@ import type { BlitzPage } from "blitz";
|
||||
import { Routes } from "blitz";
|
||||
import { atom, useAtom } from "jotai";
|
||||
|
||||
import Layout from "../../core/layouts/layout";
|
||||
import Layout from "app/core/layouts/layout";
|
||||
import ConversationsList from "../components/conversations-list";
|
||||
import NewMessageButton from "../components/new-message-button";
|
||||
import useRequireOnboarding from "../../core/hooks/use-require-onboarding";
|
||||
import useNotifications from "../../core/hooks/use-notifications";
|
||||
import MissingTwilioCredentials from "app/core/components/missing-twilio-credentials";
|
||||
import useNotifications from "app/core/hooks/use-notifications";
|
||||
import useCurrentUser from "app/core/hooks/use-current-user";
|
||||
import PageTitle from "../../core/components/page-title";
|
||||
|
||||
const Messages: BlitzPage = () => {
|
||||
useRequireOnboarding();
|
||||
const { hasFilledTwilioCredentials } = useCurrentUser();
|
||||
const { subscription, subscribe } = useNotifications();
|
||||
const setIsOpen = useAtom(bottomSheetOpenAtom)[1];
|
||||
|
||||
@ -21,11 +23,18 @@ const Messages: BlitzPage = () => {
|
||||
}
|
||||
}, [subscribe, subscription]);
|
||||
|
||||
if (!hasFilledTwilioCredentials) {
|
||||
return (
|
||||
<>
|
||||
<MissingTwilioCredentials />
|
||||
<PageTitle className="filter blur-sm absolute top-0" title="Messages" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col space-y-6 p-3">
|
||||
<h2 className="text-3xl font-bold">Messages</h2>
|
||||
</div>
|
||||
<PageTitle title="Messages" />
|
||||
<section className="flex flex-grow flex-col">
|
||||
<Suspense fallback="Loading...">
|
||||
<ConversationsList />
|
||||
|
@ -5,12 +5,9 @@ import { IoChevronBack, IoInformationCircle, IoCall } from "react-icons/io5";
|
||||
|
||||
import Layout from "../../../core/layouts/layout";
|
||||
import Conversation from "../../components/conversation";
|
||||
import useRequireOnboarding from "../../../core/hooks/use-require-onboarding";
|
||||
import useConversation from "../../hooks/use-conversation";
|
||||
|
||||
const ConversationPage: BlitzPage = () => {
|
||||
useRequireOnboarding();
|
||||
|
||||
const router = useRouter();
|
||||
const recipient = decodeURIComponent(router.params.recipient);
|
||||
const pageTitle = `Messages with ${recipient}`;
|
||||
|
@ -22,12 +22,11 @@ export default resolver.pipe(
|
||||
where: { id: organizationId },
|
||||
include: { phoneNumbers: true },
|
||||
});
|
||||
if (!organization) {
|
||||
if (!organization || !organization.phoneNumbers[0]) {
|
||||
throw new NotFoundError();
|
||||
}
|
||||
|
||||
const phoneNumberId = organization.phoneNumbers[0]!.id;
|
||||
|
||||
const phoneNumberId = organization.phoneNumbers[0].id;
|
||||
const processingState = await db.processingPhoneNumber.findFirst({ where: { organizationId, phoneNumberId } });
|
||||
if (processingState && !processingState.hasFetchedMessages) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user