Closed leirbag95 closed 11 months ago
Thanks for the PR! 👌
Changing accounts does indeed updates the address and balance in the store and dispatches the informations on the view. However it does not fetches and refresh the different products (functions, volumes, instances, ... ) of the user, can you take care of this as well ?
It's done :)
I changed the useRequest.ts by adding a triggerDeps param which allows to listen account change from all of account entities
export function useRequest<T>({
doRequest,
triggerOnMount,
triggerDeps = [],
...rest
}: UseRequestProps<T>): UseRequestReturn<T> {
...
useEffect(() => {
if (!triggerOnMount) return
request()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, triggerDeps)
LGTM!
This pull request fixes the issue mentioned in #34 . The issue was related to detecting and reloading when the Ethereum account changes from the wallet provider.
Changes Made:
window.ethereum
to detect changes in Ethereum accounts.accountsChanged
event is triggered, it reloads the interface with the updated Ethereum account.Test Plan:
Screenshots:
Adapts to the entire application, here is an example after changing account the requirements are updated and the button becomes active