Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active January 27, 2020 22:29
Show Gist options
  • Save alexytiger/63454fb5adddb8e1a4c281d70aa47cbe to your computer and use it in GitHub Desktop.
Save alexytiger/63454fb5adddb8e1a4c281d70aa47cbe to your computer and use it in GitHub Desktop.
e-book
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