fix: Hint when all invites were not sent

closes #3317
This commit is contained in:
Tom Moor
2022-04-01 18:04:13 -07:00
parent cca3d114ad
commit 4907169cfb

View File

@@ -65,11 +65,18 @@ function Invite({ onSubmit }: Props) {
setIsSaving(true); setIsSaving(true);
try { try {
await users.invite(invites); const data = await users.invite(invites);
onSubmit(); onSubmit();
showToast(t("We sent out your invites!"), {
type: "success", if (data.sent.length > 0) {
}); showToast(t("We sent out your invites!"), {
type: "success",
});
} else {
showToast(t("Those email addresses are already invited"), {
type: "success",
});
}
} catch (err) { } catch (err) {
showToast(err.message, { showToast(err.message, {
type: "error", type: "error",