Can't do a substring on account from useMoralis()

Hello there, I have been trying to perform a substring operation on the account fetched using this
code of line :
const { Moralis, account } = useMoralis(); &
console.log(account.substring(0,2) + account.substring(2,6).toUpperCase() + “…” + account.substring(38,42).toUpperCase());

For some reason, whenever i try doing that, my webpage doesn’t load. It works just fine otherwise.

Any help would be appreciated.

Do you get any errors? Check your console. That code works fine for me, make sure you’re using it when account has a valid value.

Okay, I was able to handle the problem but doing so I realized that the boolean value that is returned for isAuthenticating is actually FALSE for when it IS authenticating and TRUE for when it is NOT authenticating.
There is some problem with isAuthenticated as well.
Can you maybe check on your end?

you may need to use an useEffect, to check if isAuthenticated is true

1 Like