Skip to content

Commit

Permalink
CR changes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
shaiu committed Nov 24, 2024
1 parent 30b27bd commit 772fd65
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 37 deletions.
2 changes: 1 addition & 1 deletion packages/preload/src/eventsBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
31 changes: 0 additions & 31 deletions packages/renderer/src/components/GetOtp.module.css

This file was deleted.

11 changes: 6 additions & 5 deletions packages/renderer/src/components/GetOtp.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -10,7 +9,10 @@ const GetOtp = () => {
const [modalStatus, setModalStatus] = useState<boolean>(false);
const [inputText, setInputText] = useState('');

const closeModal = () => setModalStatus(false);
const closeModal = (inputText: string = '') => {

Check failure on line 12 in packages/renderer/src/components/GetOtp.tsx

View workflow job for this annotation

GitHub Actions / eslint

Type string trivially inferred from a string literal, remove type annotation
sendOTPResponse(inputText);
setModalStatus(false);
}

Check failure on line 15 in packages/renderer/src/components/GetOtp.tsx

View workflow job for this annotation

GitHub Actions / eslint

Missing semicolon

useEffect(() => {
if (configStore.getOtp !== undefined) {
Expand All @@ -25,8 +27,7 @@ const GetOtp = () => {
const sendInput = async (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();

sendOTPResponse(inputText);
closeModal();
closeModal(inputText);
};

if (!configStore.getOtp) {
Expand All @@ -35,7 +36,7 @@ const GetOtp = () => {

return (
<Modal show={modalStatus} onHide={closeModal}>
<Modal.Header closeButton className={styles.modalHeader}></Modal.Header>
<Modal.Header closeButton></Modal.Header>
<Modal.Body>
<FormControl
type="text"
Expand Down

0 comments on commit 772fd65

Please sign in to comment.