DigixGlobal / governance-ui-components

Governance UI reusable components library
Other
3 stars 2 forks source link

[FIX] Fix timing issue with fetching data from dao-server (#334) #335

Closed mikej-digix closed 5 years ago

mikej-digix commented 5 years ago

We have been getting issues where currentUser is null when we fetch data from the dao-server after loading a wallet. This is due to certain components in the sidebar (renderDisplayName and renderAdminItem) that try to fetch data before the authorization headers have been set. They are re-rendered when the ChallengeProof is set, but it doesn't check if the authorization headers are set.

This diff fixes that by setting the fetchPolicy of these components to cache-only, since the AddressWatcher component ensures that the query will be fetched correctly after the wallet is loaded.

This also reverts commit bb541f1cd26d6e3f6f76c2c65e2f0e341931c27b and 0b61d265f55b21d63755246950950790da2ff53a, which were hotfixes for the issue.

Test Plan