Modify case where integration bot was authorized but user didn't finish inputting their PAT -> should result in not sharing keys with bot

This commit is contained in:
Tuan Dang
2023-01-22 11:12:47 +07:00
parent 6969593b38
commit 6b80cd6590
5 changed files with 15 additions and 16 deletions
@@ -19,7 +19,6 @@ type Props = {
isOpen: boolean;
closeModal: () => void;
selectedIntegrationOption: IntegrationOption | null;
handleBotActivate: () => Promise<void>;
integrationOptionPress: (integrationOption: IntegrationOption) => void;
};
@@ -27,20 +26,16 @@ const ActivateBotDialog = ({
isOpen,
closeModal,
selectedIntegrationOption,
handleBotActivate,
integrationOptionPress
}: Props) => {
const { t } = useTranslation();
const submit = async () => {
try {
// 1. activate bot
await handleBotActivate();
// type check
if (!selectedIntegrationOption) return;
// 2. start integration or probe for PAT
// start integration or probe for PAT
integrationOptionPress(selectedIntegrationOption);
} catch (err) {
@@ -52,7 +52,6 @@ const IntegrationAccessTokenDialog = ({
<div>
<Transition appear show={isOpen} as={Fragment}>
<Dialog as="div" className="relative z-10" onClose={() => {
console.log('onClose');
closeModal();
}}>
<Transition.Child