-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { EXPECTED_CHAIN_ID } from './constants'; | ||
import env from './environment'; | ||
|
||
const CHAIN_ID = 'CHAIN_ID'; | ||
|
||
let currentChain = localStorage.getItem(CHAIN_ID) ?? +env(CHAIN_ID) ?? 100; // default xdai; | ||
let currentChain = | ||
env('FORCE_CHAIN_ID') ?? localStorage.getItem(CHAIN_ID) ?? env('DEFAULT_CHAIN_ID') ?? 100; // default xdai | ||
|
||
export function getCurrentChain() { | ||
return currentChain; | ||
} | ||
|
||
export function setCurrentChain(chainId: number) { | ||
currentChain = chainId; | ||
localStorage.setItem(CHAIN_ID, chainId.toString()); | ||
if (EXPECTED_CHAIN_ID.includes(chainId)) { | ||
currentChain = chainId; | ||
localStorage.setItem(CHAIN_ID, chainId.toString()); | ||
} | ||
} |
c5e9fce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
quests – ./
quests.vercel.app
quests-git-force-chain-1hive.vercel.app
quests-1hive.vercel.app
quests.1hive.org