Prevent getQuotaForRegion when region undefined (#107)
* Remove unused imports * Prevent error occurring when getQuotaForRegion is called with region undefined --------- Co-authored-by: Josh Tomaino <josh@cloverleaf.me>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import { Input } from "@unsend/ui/src/input";
|
||||
import { Label } from "@unsend/ui/src/label";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
|
@@ -1,7 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { LogOut } from "lucide-react";
|
||||
import { signOut } from "next-auth/react";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import React from "react";
|
||||
|
@@ -2,15 +2,12 @@
|
||||
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import { Input } from "@unsend/ui/src/input";
|
||||
import { Label } from "@unsend/ui/src/label";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogDescription, DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
DialogTrigger
|
||||
} from "@unsend/ui/src/dialog";
|
||||
|
||||
import {
|
||||
|
@@ -22,8 +22,7 @@ import {
|
||||
REGEXP_ONLY_DIGITS_AND_CHARS,
|
||||
} from "@unsend/ui/src/input-otp";
|
||||
import { Input } from "@unsend/ui/src/input";
|
||||
import { env } from "~/env";
|
||||
import { BuiltInProviderType, Provider } from "next-auth/providers/index";
|
||||
import { BuiltInProviderType } from "next-auth/providers/index";
|
||||
import Spinner from "@unsend/ui/src/spinner";
|
||||
import Link from "next/link";
|
||||
import { useTheme } from "@unsend/ui";
|
||||
|
@@ -1,8 +1,5 @@
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import { Suspense } from "react";
|
||||
import {
|
||||
unsubscribeContact,
|
||||
subscribeContact,
|
||||
} from "~/server/service/campaign-service";
|
||||
import ReSubscribe from "./re-subscribe";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
@@ -94,8 +94,11 @@ export const AddSesSettingsForm: React.FC<SesSettingsProps> = ({
|
||||
|
||||
const onRegionInputOutOfFocus = async () => {
|
||||
const region = form.getValues("region");
|
||||
const quota = await utils.admin.getQuotaForRegion.fetch({ region });
|
||||
form.setValue("sendRate", quota ?? 1);
|
||||
|
||||
if (region) {
|
||||
const quota = await utils.admin.getQuotaForRegion.fetch({ region });
|
||||
form.setValue("sendRate", quota ?? 1);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user