Skip to content

Commit

Permalink
🩹Fix no protocols enabled on network change
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPoblete committed Sep 4, 2024
1 parent bf4882a commit af19e05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ You have successfully set up Soroswap on your local machine! Start swapping, poo

If you want to add or remove supported protocols, you can do so by editing the `functions/generateRoute.ts:79-97` file and adding or removing the protocols you want to support on swap.

> [!HINT]
> You can found the list of supported protocols in the `soroswap-router-sdk` repository.

## 🧪🔨 Testing 🧪🔨
To execute the tests, you must first start the development container. To do this, run the following command from your host machine:

Expand Down
6 changes: 3 additions & 3 deletions src/functions/generateRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ export const useRouterSDK = () => {

const getValuebyKey = (key: string) => {
let value = protocolsStatus.find((p) => p.key === key)?.value;
if (value === undefined && key === Protocols.SOROSWAP) {
return true;
}
if (typeof value === 'undefined') {
return false;
}
if (typeof value === 'undefined' && key === Protocols.SOROSWAP) {
return true;
}
if (value === true || value === false) {
return value;
}
Expand Down

0 comments on commit af19e05

Please sign in to comment.