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:
@@ -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