-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix beacon peers updates #1764
Fix beacon peers updates #1764
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
59c6114
to
92d1b92
Compare
@@ -12,8 +12,8 @@ import { | |||
} from "@chakra-ui/react"; | |||
import { useGetConnectionInfo, usePeers, useRemovePeer } from "@umami/state"; | |||
import { parsePkh } from "@umami/tezos"; | |||
import { capitalize, noop } from "lodash"; | |||
import { Fragment, useEffect, useState } from "react"; | |||
import { capitalize } from "lodash"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize from 'lodash/capitalize'
please
}; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering why have deleted this component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to clean up the code
}, [refresh]); | ||
|
||
return { peers, refresh }; | ||
const query = useQuery({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very elegant solution!
@@ -108,7 +107,7 @@ export const useAddPeer = () => { | |||
.deserialize(payload) | |||
.then(parsePeerInfo) | |||
.then(peer => WalletClient.addPeer(peer as ExtendedPeerInfo)) | |||
.then(refresh) | |||
.then(() => refresh()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just refresh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it passes its first argument to the refresh function which also has an optional argument which has nothing to do with the peers
@@ -37,7 +38,9 @@ const customRenderHook = < | |||
const store = options?.store ?? makeStore(); | |||
|
|||
const Wrapper = ({ children }: PropsWithChildren) => ( | |||
<Provider store={store}>{children}</Provider> | |||
<QueryClientProvider client={new QueryClient()}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react-query recommends to declare queryClient outside of Wrapper component
92d1b92
to
2d1132a
Compare
Types of changes