Skip to content

Commit

Permalink
Soulnames must be something to display mint page
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Mar 2, 2023
1 parent 1becfba commit 7692951
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/components/masa-interface/masa-interface.tsx
Expand Up @@ -50,11 +50,21 @@ export const MasaInterface = ({
if (forcedPage) return forcedPage;
if (!isConnected) return 'connector';

console.log({
forcedPage,
soulnames,
scope,
isLoggedIn,
identity,
isConnected,
provider,
});

// if (network && !chain?.name.includes(network)) return 'switchNetwork';
if (!isLoggedIn && provider) return 'authenticate';
if (!identity?.identityId && scope?.includes('identity'))
return 'createIdentity';
if ((soulnames?.length ?? 0) === 0 && scope?.includes('soulname'))
if (soulnames && soulnames.length === 0 && scope?.includes('soulname'))
return 'createSoulname';
if (identity && !creditScores?.length && scope?.includes('credit-score'))
return 'createCreditScore';
Expand Down
3 changes: 2 additions & 1 deletion src/provider/masa-context-provider.tsx
Expand Up @@ -146,14 +146,15 @@ export const MasaContextProvider = ({

const connect = useCallback(
(options?: { scope?: string[]; callback?: () => void }) => {
console.log({forcedPage})
setModalOpen(true);
setForcedPage?.(null);
if (options?.scope) setScope(options.scope);
if (typeof options?.callback === 'function') {
setModalCallback(() => options?.callback);
}
},
[setModalOpen, setModalCallback, setScope, setForcedPage]
[setModalOpen, setModalCallback, setScope, setForcedPage, forcedPage]
);

const openMintSoulnameModal = useCallback(
Expand Down
2 changes: 0 additions & 2 deletions src/provider/use-metamask.ts
@@ -1,8 +1,6 @@
import { useCallback, useEffect, useState } from 'react';
import { useMasa } from './use-masa';
import { getWeb3Provider } from '../helpers';
// localStorage.removeItem("account");
// acc = localStorage.setItem("account", accounts1);

export const useMetamask = ({
disabled,
Expand Down

0 comments on commit 7692951

Please sign in to comment.