From cb67b4175dac3958f936472e8fa8d0ff378adb89 Mon Sep 17 00:00:00 2001 From: Magic Cat <37407870+MonikaCat@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:42:41 +0700 Subject: [PATCH] fix: account page stuck on loading (#1315) ## Description Closes: #XXXX [BDU-1148](https://forbole.atlassian.net/browse/BDU-1148) --- ### Author Checklist _All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues._ I have... - [x] ran linting via `yarn lint` - [ ] wrote tests where necessary - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] targeted the correct branch - [x] provided a link to the relevant issue or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed - [x] added a changeset via [`yarn && yarn changeset`](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) [BDU-1148]: https://forbole.atlassian.net/browse/BDU-1148?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- .changeset/stale-rabbits-smash.md | 5 +++++ packages/ui/src/screens/account_details/hooks.ts | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .changeset/stale-rabbits-smash.md diff --git a/.changeset/stale-rabbits-smash.md b/.changeset/stale-rabbits-smash.md new file mode 100644 index 0000000000..c581ae06e3 --- /dev/null +++ b/.changeset/stale-rabbits-smash.md @@ -0,0 +1,5 @@ +--- +'ui': patch +--- + +fix account page stuck on loading diff --git a/packages/ui/src/screens/account_details/hooks.ts b/packages/ui/src/screens/account_details/hooks.ts index b33185e077..75bd2da116 100644 --- a/packages/ui/src/screens/account_details/hooks.ts +++ b/packages/ui/src/screens/account_details/hooks.ts @@ -236,8 +236,13 @@ export const useAccountDetails = () => { skip: !extra.profile || !address, }); useEffect( - () => setState((prevState) => ({ ...prevState, desmosProfile: dataDesmosProfile?.[0] })), - [dataDesmosProfile] + () => + setState((prevState) => ({ + ...prevState, + desmosProfile: dataDesmosProfile?.[0], + loading: loadingDesmosProfile, + })), + [dataDesmosProfile, loadingDesmosProfile] ); const commission = useCommission(address); @@ -278,10 +283,5 @@ export const useAccountDetails = () => { })); }, [handleSetState, address, withdrawalAddress.withdrawalAddress?.address]); - if (loadingDesmosProfile) state.loading = true; - return { state }; }; -// function useBoundingBalance(_address?: string) { -// throw new Error('Function not implemented.'); -// }