diff --git a/mobile/app/home/profile.tsx b/mobile/app/home/profile.tsx index 4fdcd84..30e5dd9 100644 --- a/mobile/app/home/profile.tsx +++ b/mobile/app/home/profile.tsx @@ -87,6 +87,7 @@ export default function Page() { }; const onPressLogout = async () => { + dispatch(clearLinking()); dispatch(logedOut()); }; diff --git a/mobile/redux/features/accountSlice.ts b/mobile/redux/features/accountSlice.ts index 1531c1e..68f5cb5 100644 --- a/mobile/redux/features/accountSlice.ts +++ b/mobile/redux/features/accountSlice.ts @@ -33,11 +33,17 @@ export const loggedIn = createAsyncThunk("account/ }); async function getAccountName(bech32: string, gnonative: GnoNativeApi) { - const accountNameStr = await gnonative.qEval("gno.land/r/demo/users", `GetUserByAddress("${bech32}").Name`); - console.log("GetUserByAddress result:", accountNameStr); - const accountName = accountNameStr.match(/\("(\w+)"/)?.[1]; - console.log("GetUserByAddress after regex", accountName); - return accountName + try { + console.log("GetUserByAddress request:", bech32); + const accountNameStr = await gnonative.qEval("gno.land/r/demo/users", `GetUserByAddress("${bech32}").Name`); + console.log("GetUserByAddress result:", accountNameStr); + const accountName = accountNameStr.match(/\("(\w+)"/)?.[1]; + console.log("GetUserByAddress after regex", accountName); + return accountName + } catch (error) { + console.error("Error getting account name", error); + } + return undefined; } interface AvatarCallTxParams {