Skip to content

fix: clear custom API key on wallet disconnect and improve vault crea…#33

Merged
JosueBrenes merged 1 commit intomainfrom
develop
Jan 13, 2026
Merged

fix: clear custom API key on wallet disconnect and improve vault crea…#33
JosueBrenes merged 1 commit intomainfrom
develop

Conversation

@JosueBrenes
Copy link
Contributor

This pull request primarily focuses on improving error handling and user experience in API key validation and vault creation workflows, along with some minor code cleanups and dependency adjustments. The most significant changes are related to how API key validation errors are handled, ensuring proper state resets when the wallet changes, and refining the logic for enabling the "Create Vault" button.

Error Handling and Validation Improvements:

  • Updated error handling in API key validation to use a generic catch block (without the error parameter) in DynamicIssueForm, VaultAuthorize, and VaultDashboard to avoid unused variable warnings and simplify error handling. [1] [2] [3]
  • Improved the logic for enabling/disabling the "Create Vault" button to ensure it is only active when a valid API key is present and not being validated, and disabled if there are validation errors.
  • Removed redundant client-side API key presence checks in the handleCreateVault function, relying instead on button state for validation.

State Management Enhancements:

  • Added a useEffect in VaultDashboard to clear customApiKey, validation error, and validation state when the wallet disconnects or changes, preventing stale or invalid state when switching wallets.

Code Cleanup and Dependency Updates:

  • Removed unused imports from usePublicApiKey.ts and wallet.provider.tsx for cleaner code and to prevent potential dead code issues. [1] [2]
  • Removed an unused temporary constant from network-switch-modal.tsx.

…tion button logic

- Added a useEffect to clear the custom API key and reset validation states when the wallet address changes or disconnects.
- Updated the vault creation button's disabled state logic to ensure it only requires a valid API key or validated custom API key for enabling the button.
@vercel
Copy link
Contributor

vercel bot commented Jan 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dapp Building Building Preview, Comment Jan 13, 2026 11:59pm

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JosueBrenes JosueBrenes merged commit 0c26096 into main Jan 13, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant