Conversation
|
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/wallets/smart-wallet/expo/components/headless-signing.tsx
Line: 54-56
Comment:
**Errors silently swallowed in `initWallet`**
The `catch` block in `initWallet` only calls `console.error`, but doesn't update the UI error state (`setUiError`) or show an `Alert` to the user. This is inconsistent with how `handleAction` works, and means the new validation error thrown at lines 45–48 will never be surfaced to the user — it will only appear in the console.
Consider refactoring `initWallet` to delegate to `handleAction` by extracting the core logic into the passed callback. That way `setUiError` and `Alert.alert` are triggered on failure, consistent with how `handleSendOtpEmail` and `handleVerifyOtpInput` work.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "adding signer withou..." |
| } catch (error) { | ||
| console.error("Error initializing wallet:", error); | ||
| } finally { |
There was a problem hiding this comment.
Errors silently swallowed in
initWallet
The catch block in initWallet only calls console.error, but doesn't update the UI error state (setUiError) or show an Alert to the user. This is inconsistent with how handleAction works, and means the new validation error thrown at lines 45–48 will never be surfaced to the user — it will only appear in the console.
Consider refactoring initWallet to delegate to handleAction by extracting the core logic into the passed callback. That way setUiError and Alert.alert are triggered on failure, consistent with how handleSendOtpEmail and handleVerifyOtpInput work.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/wallets/smart-wallet/expo/components/headless-signing.tsx
Line: 54-56
Comment:
**Errors silently swallowed in `initWallet`**
The `catch` block in `initWallet` only calls `console.error`, but doesn't update the UI error state (`setUiError`) or show an `Alert` to the user. This is inconsistent with how `handleAction` works, and means the new validation error thrown at lines 45–48 will never be surfaced to the user — it will only appear in the console.
Consider refactoring `initWallet` to delegate to `handleAction` by extracting the core logic into the passed callback. That way `setUiError` and `Alert.alert` are triggered on failure, consistent with how `handleSendOtpEmail` and `handleVerifyOtpInput` work.
How can I resolve this? If you propose a fix, please make it concise.
Description
Fix the calling of add signer
Test plan
We are still throwing in createDeviceSigner
Package updates