-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a hidden LocalSharedArrayBuffer component that enables liquidity…
… mining charts to load on localhost when using mainnet (#1381)
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { currentNetwork } from '../../../utils/classifiers'; | ||
export function LocalSharedArrayBuffer() { | ||
if (process.env.NODE_ENV === 'development' && currentNetwork === 'mainnet') { | ||
// See https://github.com/facebook/react/issues/20829#issuecomment-802088260 | ||
return ( | ||
<script> | ||
if (!crossOriginIsolated) SharedArrayBuffer = ArrayBuffer; | ||
</script> | ||
); | ||
} | ||
|
||
return null; | ||
} | ||
LocalSharedArrayBuffer(); |
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