rename hasActiveSubscription from useCurrentUser() to hasOngoingSubscription

This commit is contained in:
m5r
2021-10-21 00:01:03 +02:00
parent 6dbdeac4d3
commit 1dd1c2bafe
6 changed files with 19 additions and 9 deletions

View File

@ -11,7 +11,7 @@ import InactiveSubscription from "app/core/components/inactive-subscription";
import PhoneCallsList from "../components/phone-calls-list";
const PhoneCalls: BlitzPage = () => {
const { hasFilledTwilioCredentials, hasPhoneNumber, hasActiveSubscription } = useCurrentUser();
const { hasFilledTwilioCredentials, hasPhoneNumber, hasOngoingSubscription } = useCurrentUser();
if (!hasFilledTwilioCredentials || !hasPhoneNumber) {
return (
@ -22,7 +22,7 @@ const PhoneCalls: BlitzPage = () => {
);
}
if (!hasActiveSubscription) {
if (!hasOngoingSubscription) {
return (
<>
<InactiveSubscription />

View File

@ -15,7 +15,7 @@ import useCurrentUser from "app/core/hooks/use-current-user";
import KeypadErrorModal from "../components/keypad-error-modal";
const KeypadPage: BlitzPage = () => {
const { hasFilledTwilioCredentials, hasPhoneNumber, hasActiveSubscription } = useCurrentUser();
const { hasFilledTwilioCredentials, hasPhoneNumber, hasOngoingSubscription } = useCurrentUser();
const router = useRouter();
const [isKeypadErrorModalOpen, setIsKeypadErrorModalOpen] = useState(false);
const [phoneCalls] = usePhoneCalls();
@ -90,8 +90,10 @@ const KeypadPage: BlitzPage = () => {
return;
}
if (!hasActiveSubscription) {
if (!hasOngoingSubscription) {
// TODO
setIsKeypadErrorModalOpen(true);
return;
}
if (phoneNumber === "") {