diff --git a/src/context/intermediate/modals/Prompt.tsx b/src/context/intermediate/modals/Prompt.tsx
index b3d15395..31fc2d59 100644
--- a/src/context/intermediate/modals/Prompt.tsx
+++ b/src/context/intermediate/modals/Prompt.tsx
@@ -168,10 +168,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
break;
}
- onClose();
+ return true;
} catch (err) {
setError(takeError(err));
setProcessing(false);
+ return false;
}
},
},
@@ -210,10 +211,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
try {
props.target.delete();
- onClose();
+ return true;
} catch (err) {
setError(takeError(err));
setProcessing(false);
+ return false;
}
},
},
@@ -316,10 +318,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
})
?.kick();
- onClose();
+ return true;
} catch (err) {
setError(takeError(err));
setProcessing(false);
+ return false;
}
},
},
@@ -366,10 +369,12 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
await props.target.banUser(props.user._id, {
reason,
});
- onClose();
+
+ return true;
} catch (err) {
setError(takeError(err));
setProcessing(false);
+ return false;
}
},
},
@@ -438,10 +443,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
);
}
- onClose();
+ return true;
} catch (err) {
setError(takeError(err));
setProcessing(false);
+ return false;
}
},
},
@@ -512,11 +518,13 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
},
],
});
- onClose();
+
setProcessing(false);
+ return true;
} catch (err) {
setError(takeError(err));
setProcessing(false);
+ return false;
}
},
},
diff --git a/src/context/intermediate/popovers/CreateBot.tsx b/src/context/intermediate/popovers/CreateBot.tsx
index 515063e7..80a8032c 100644
--- a/src/context/intermediate/popovers/CreateBot.tsx
+++ b/src/context/intermediate/popovers/CreateBot.tsx
@@ -29,7 +29,6 @@ export function CreateBotModal({ onClose, onCreate }: Props) {
try {
const { bot } = await client.bots.create({ name });
onCreate(bot);
- onClose();
} catch (err) {
setError(takeError(err));
}
@@ -43,7 +42,10 @@ export function CreateBotModal({ onClose, onCreate }: Props) {
{
confirmation: true,
palette: "accent",
- onClick: handleSubmit(onSubmit),
+ onClick: async () => {
+ await handleSubmit(onSubmit);
+ return true;
+ },
children: