Skip to content

Commit

Permalink
chore: fix disable chain logic (#298)
Browse files Browse the repository at this point in the history
* chore: replace includes with === in TopFlows

* chore: convert a disabled-chains string into array

* chore: revert TopFlows

* chore: remove comment
  • Loading branch information
npty authored Apr 7, 2023
1 parent d383385 commit 0d1c659
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Environment } from "../utils/enums";
export const ENVIRONMENT = process.env.NEXT_PUBLIC_ENVIRONMENT as Environment;
export const SOCKET_API = process.env.NEXT_PUBLIC_SOCKET_API as string;
export const DISABLED_CHAIN_NAMES =
process.env.NEXT_PUBLIC_DISABLED_CHAIN_NAMES || "";
process.env.NEXT_PUBLIC_DISABLED_CHAIN_NAMES?.toLowerCase()?.split(",") || [];
export const UNDER_MAINTENANCE =
process.env.NEXT_PUBLIC_UNDER_MAINTENANCE === "true" ? true : false;

Expand Down
4 changes: 2 additions & 2 deletions hooks/init/useInitialChainList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ export const useInitialChainList = () => {
let srcChainFound = uniqueChains.find(
(chain) =>
chain.chainName?.toLowerCase() === source &&
!DISABLED_CHAIN_NAMES?.toLowerCase().includes(source?.toLowerCase())
!DISABLED_CHAIN_NAMES.includes(source?.toLowerCase())
) as ChainInfo;
let destChainFound = uniqueChains.find(
(chain) =>
chain.chainName?.toLowerCase() === destination &&
!DISABLED_CHAIN_NAMES?.toLowerCase().includes(
!DISABLED_CHAIN_NAMES.includes(
destination?.toLowerCase()
)
) as ChainInfo;
Expand Down
2 changes: 1 addition & 1 deletion utils/api/getDisabledChains.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DISABLED_CHAIN_NAMES } from "../../config/constants";

export function getDisabledChains(): string | undefined {
export function getDisabledChains(): string[] {
return DISABLED_CHAIN_NAMES;
}

1 comment on commit 0d1c659

@vercel
Copy link

@vercel vercel bot commented on 0d1c659 Apr 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.