diff --git a/packages/preload/src/eventsBridge.ts b/packages/preload/src/eventsBridge.ts index 098cb6ed..e84142bf 100644 --- a/packages/preload/src/eventsBridge.ts +++ b/packages/preload/src/eventsBridge.ts @@ -93,5 +93,5 @@ export async function createSpreadsheet(spreadsheetId: string, credentials: Cred } export function sendOTPResponse(input: string) { - electron.ipcRenderer.send('get-otp-response', input); + electron.ipcRenderer.invoke('get-otp-response', input); } diff --git a/packages/renderer/src/components/GetOtp.module.css b/packages/renderer/src/components/GetOtp.module.css deleted file mode 100644 index d37ef49f..00000000 --- a/packages/renderer/src/components/GetOtp.module.css +++ /dev/null @@ -1,31 +0,0 @@ -.container { - height: 100%; - display: flex; - align-items: center; - justify-content: center; -} - -.buttonsContainer { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - gap: 1.5vh; -} - -.pointer { - cursor: pointer; -} - -.customGap { - gap: 6rem; -} - -.contentContainer { - margin-top: 5rem; -} - -.modalWide { - max-width: unset; - width: 70%; -} diff --git a/packages/renderer/src/components/GetOtp.tsx b/packages/renderer/src/components/GetOtp.tsx index 2915c32d..c45c14da 100644 --- a/packages/renderer/src/components/GetOtp.tsx +++ b/packages/renderer/src/components/GetOtp.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from 'react'; -import styles from './GetOtp.module.css'; import { Button, FormControl, Modal } from 'react-bootstrap'; import { observer } from 'mobx-react-lite'; import { useConfigStore } from '/@/store/ConfigStore'; @@ -10,7 +9,10 @@ const GetOtp = () => { const [modalStatus, setModalStatus] = useState(false); const [inputText, setInputText] = useState(''); - const closeModal = () => setModalStatus(false); + const closeModal = (inputText: string = '') => { + sendOTPResponse(inputText); + setModalStatus(false); + } useEffect(() => { if (configStore.getOtp !== undefined) { @@ -25,8 +27,7 @@ const GetOtp = () => { const sendInput = async (e: React.MouseEvent) => { e.preventDefault(); - sendOTPResponse(inputText); - closeModal(); + closeModal(inputText); }; if (!configStore.getOtp) { @@ -35,7 +36,7 @@ const GetOtp = () => { return ( - +