Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Swap warning error when currency undefined (#10790)
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the `useWarningImport` hook and the `shouldShowSwapWarning` utility function to handle optional `Currency` parameters. This enhances the flexibility of the code by allowing the functions to work with undefined values for currency inputs. ### Detailed summary - Updated `swapWarningHandler` to accept an optional `Currency` parameter. - Modified `shouldShowSwapWarning` to accept an optional `Currency` parameter instead of a required `Token`. - Added a check for `swapCurrency` being defined before processing in `shouldShowSwapWarning`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information