Skip to content
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

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

serjonya-trili
Copy link
Contributor

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Copy link

vercel bot commented Aug 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umami-v2-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 11:54am
umami-v2-web-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 11:54am

@@ -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";
Copy link
Contributor

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

};

/**
Copy link
Contributor

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?

Copy link
Contributor Author

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({
Copy link
Contributor

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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just refresh?

Copy link
Contributor Author

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()}>
Copy link
Contributor

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

@serjonya-trili serjonya-trili merged commit e8b1b3f into main Aug 21, 2024
6 checks passed
@serjonya-trili serjonya-trili deleted the fix-beacon-connection-updates branch August 21, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants