EmerisHQ / demeris

Emeris web app
https://app.emeris.com/
Apache License 2.0
11 stars 2 forks source link

chore: preserved cross account loaded data #1848

Open faboweb opened 2 years ago

faboweb commented 2 years ago

staking balances get wiped on sign out instead of keeping them for each account like the balances

github-actions[bot] commented 2 years ago

Visit the preview URL for this PR (updated for commit f578417):

https://emeris-app--pr1848-chore-improve-sign-o-z0v2xnc1.web.app

(expires Wed, 22 Jun 2022 10:27:23 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

clockworkgr commented 2 years ago

staking balances get wiped on sign out instead of keeping them for each account like the balances

They are supposed to get wiped out....On sign out we remove account specific data because we're signing out.

Technically this PR changes nothing.

state.balances contains account balances as well as module balances (used for pool token price calculations)

getter filters out module balances to only get account balances and sign_out only deletes account balances so module balances are unaffected.

state.stakingBalances and state.unbondingDelegations ONLY contain account data (i.e. their keyhash keys are ALWAYS the keyhashes in getKeyhashes so: a) getter filtering is unnecessary b) sign_out deletion of said keyhashes results in the same empty object as previous code

faboweb commented 2 years ago

In a multi account setup you don't want to reload the data on every account switch I thought. On a sign out you would remove the data you signed out of I thought. In an account overview you also probably want to show total balances of all accounts. Currently only data for one account can be loaded in parallel.

clockworkgr commented 2 years ago

In a multi account setup you don't want to reload the data on every account switch I thought. On a sign out you would remove the data you signed out of I thought. In an account overview you also probably want to show total balances of all accounts. Currently only data for one account can be loaded in parallel.

app is not set for multiaccount though...its only supposed to handle one account at the time