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 problem with edit custom network #304

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

bogos
Copy link
Contributor

@bogos bogos commented Nov 28, 2023

🐞[Custom network] If you edit the name of a custom network, the 'last contracts' title is not updated with this new namehttps://app.clickup.com/t/86a1fgkgw

@bogos bogos requested a review from henrypalacios November 28, 2023 15:45
Copy link

vercel bot commented Nov 28, 2023

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

Name Status Preview Updated (UTC)
polkadot-contract-wizard ✅ Ready (Inspect) Visit Preview Nov 28, 2023 3:45pm

@bogos bogos requested a review from alongoni November 28, 2023 15:45
@camimancusi
Copy link

❌Failed
It's not working for me

image

@@ -21,6 +25,19 @@ export function ContractsTableWidget() {
userContractItems = items.filter(item => item.hidden === false)
}

const updateChain = useCallback(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the function with the useCallback is not passed to a child I don't see the point, as this has a computational cost and I would prefer to give it to a useMemo in useContractItems and run the simple logic in the effects.

Such as:

const userContractItems = useMemo(() => {
    return Array.isArray(items) ? items.filter(item => item.hidden === false) : [];
  }, [items]);

  useEffect(() => {
    const updatedChain = getChain(networkConnected);
    setChain(updatedChain);
  }, [networkConnected]);

  useMultiEventListener([WalletConnectionEvents.customChainNameChanged], () => {
    const updatedChain = getChain(networkConnected);
    setChain(updatedChain);
  });

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.

3 participants