-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New: Add the Otp Modal #619
base: feature/one-zerop-bank
Are you sure you want to change the base?
Conversation
Copilot
AI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 suggestion.
Files not reviewed (1)
- packages/renderer/src/components/GetOtp.module.css: Language not supported
Comments skipped due to low confidence (1)
packages/renderer/src/components/GetOtp.tsx:49
- [nitpick] The button text is in Hebrew. Please confirm that this is intentional and correct.
הכנס קוד
packages/preload/src/eventsBridge.ts
Outdated
@@ -91,3 +91,7 @@ export async function electronGoogleOAuth2Connector(): Promise<Credentials> { | |||
export async function createSpreadsheet(spreadsheetId: string, credentials: Credentials): Promise<string> { | |||
return electron.ipcRenderer.invoke('createSpreadsheet', spreadsheetId, credentials); | |||
} | |||
|
|||
export async function sendUserInput(input: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function sendUserInput lacks error handling, which could lead to unhandled promise rejections. Consider adding a try-catch block.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baruchiro all other methods don't have error handling at all, so I don't think we should start now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
הקופיילוט די גרוע, תתעלם
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the issues and I will review it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now with the comments
packages/preload/src/eventsBridge.ts
Outdated
export async function sendUserInput(input: string) { | ||
await electron.ipcRenderer.send('get-otp-response', input); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export async function sendUserInput(input: string) { | |
await electron.ipcRenderer.send('get-otp-response', input); | |
} | |
export async function sendOTPResponse(input: string) { | |
await electron.ipcRenderer.send('get-otp-response', input); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
packages/preload/src/eventsBridge.ts
Outdated
@@ -91,3 +91,7 @@ export async function electronGoogleOAuth2Connector(): Promise<Credentials> { | |||
export async function createSpreadsheet(spreadsheetId: string, credentials: Credentials): Promise<string> { | |||
return electron.ipcRenderer.invoke('createSpreadsheet', spreadsheetId, credentials); | |||
} | |||
|
|||
export async function sendUserInput(input: string) { | |||
await electron.ipcRenderer.send('get-otp-response', input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why send
and not invoke
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still learning. What's the difference?
const [modalStatus, setModalStatus] = useState<ModalStatus>(ModalStatus.HIDDEN); | ||
const [inputText, setInputText] = useState(''); | ||
|
||
const closeModal = () => setModalStatus(ModalStatus.HIDDEN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ModalStatus
is to reuse the main modal (Body.tsx
) for different usages.
Here you create a new Modal, I think you can just use a boolean state to decide if the Modal is open or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. changed to boolean
No description provided.