Skip to content

Commit

Permalink
fix: getCurrentAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
2fd committed Mar 26, 2020
1 parent 0e053e8 commit d81eba4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/utils/auth/getCurrentAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import EmptyAccountsError from '../errors/EmptyAccountsError';
import getProvider from './getProvider';

export default async function getCurrentAddress() {
const provider = await getProvider()
let accounts: Address[] = await provider.enabled();
let accounts: Address[] = await getProvider().enabled();
if (accounts.length === 0) {
// This could happen if metamask was not enabled
throw new EmptyAccountsError();
Expand Down
2 changes: 1 addition & 1 deletion src/utils/auth/getProvider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isMobile from '../isMobile';
let FIXED_PROVIDER = false;

export default async function getProvider() {
export default function getProvider() {
const provider = (window as any).ethereum;
if (!FIXED_PROVIDER) {
// Hack for old providers and mobile providers which does not have a hack to convert send to sendAsync
Expand Down

0 comments on commit d81eba4

Please sign in to comment.