Last active
January 27, 2020 22:29
-
-
Save alexytiger/63454fb5adddb8e1a4c281d70aa47cbe to your computer and use it in GitHub Desktop.
e-book
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
metaMaskEnabled$ = createEffect(() => | |
this.actions$.pipe( | |
ofType(ROOT_EFFECTS_INIT), | |
map(() => { | |
const ethereum = (window as any).ethereum; | |
// Returns true or false, representing whether the user has MetaMask installed. | |
if (!ethereum || !ethereum.isMetaMask) { | |
return ErrorActions.errorMessage({ errorMsg: `Please install MetaMask.` }); | |
} | |
return Web3ProviderActions.emptyAction(); | |
}) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment