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

DAPP-1563 fixed useAccount and ChannelsDataStore erros #1907

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

rohitmalhotra1420
Copy link
Collaborator

@rohitmalhotra1420 rohitmalhotra1420 commented Oct 8, 2024

Pull Request Template

Ticket Number

Description

  • Problem/Feature:

  • Fixed the state issue in useAccount hook an d moved the state to global context

  • Commented out ChannelDataStore usage

Type of Change

  • Bug fix
  • New feature
  • Code refactor
  • Documentation update
  • Other (please describe):

Checklist

  • Quick PR: Is this a quick PR? Can be approved before finishing a coffee.
    • Quick PR label added
  • Not Merge Ready: Is this PR dependent on some other PR/tasks and not ready to be merged right now.
    • DO NOT Merge PR label added

Frontend Guidelines

Build & Testing

  • No errors in the build terminal
  • Engineer has tested the changes on their local environment
  • Engineer has tested the changes on deploy preview

Screenshots/Video with Explanation

  • Before: Explain the previous behavior

  • After: What's changed now

Additional Context

Review & Approvals

  • Self-review completed
  • Code review by at least one other engineer
  • Documentation updates if applicable

Notes

@rohitmalhotra1420 rohitmalhotra1420 added the bug Something isn't working label Oct 8, 2024
@rohitmalhotra1420 rohitmalhotra1420 changed the title DAPP-1563fixed useAccount and ChannelsDataStore erros DAPP-1563 fixed useAccount and ChannelsDataStore erros Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

In src/App.tsx:

  • There is a missing closing parenthesis in the channelAutomaticExpiryDate assignment.
  • In the useEffect hook, there is a typo in the CHANNNEL_DEACTIVATED_STATE constant. It should be CHANNEL_DEACTIVATED_STATE.
  • In the useEffect hook, there is a missing closing parenthesis after the if condition.
  • In the useEffect hook, the return statement should not be followed by a comma.

In src/components/ChannelDetails.jsx:

  • The addDelegate function is missing a closing curly brace at the end.
  • There is a missing closing parenthesis in the channelAutomaticExpiryDate assignment.
  • The useEffect hook has a missing opening curly brace after the arrow function.
  • In the useEffect hook, there is a missing closing parenthesis after the if condition.
  • In the useEffect hook, the return statement should not be followed by a comma.
  • There is an unfinished comment 'BEGIN CHANGE' that needs an ending comment as 'END CHANGE'.

In src/components/GlobalContext.tsx:

  • The GlobalContextProvider component is missing a closing curly brace at the end of the component definition.

In src/hooks/useAccount.tsx:

  • There is an incomplete return statement in the account calculation.

Please make the necessary corrections in the respective files. Let me know if you need further assistance.

Copy link

github-actions bot commented Oct 8, 2024

I've found some issues in the code:

  1. In ChannelDetails.jsx:
  • There is a missing '}' after the useState declaration for verifyingChannel.
  • There is a missing '}' after the declaration of channelAutomaticExpiryDate variable.
  • The useEffect hook is missing a closing '}'.
  • The if statement before the async function in the useEffect hook is missing a closing '}'.
  • Within the async function in the useEffect hook, there is a missing closing '}'.
  • In the addDelegate function, there is a missing closing '}'.
  • In the block where delegatees are checked, there is a missing closing '}' after setting the channel address for onCoreNetwork condition.
  • The async function within the account check is missing a closing '}'.
  • The async function for channelDelegates is missing a closing '}'.
  1. In InitState.tsx:
  • The second 'useEffect' hook is missing a closing '}'.
  • The async function checkUserForEthAlias is missing a closing '}' after the 'return { aliasEth: null, aliasVerified: null }' statement.
  • The async function checkUserForAlias is missing a closing '}' after the 'return;' statement.
  1. In useAccount.tsx:
  • In the account useMemo function, there are two 'return' statements, and the second one will never be reached. It should be removed.
  • In the chainId useMemo function, there is an extra 'return' statement. The 'return readOnlyWallet;' statement should be inside an 'else' block after the 'return ethers.utils.getAddress(wallet.accounts[0].address);' statement.

Please make the necessary corrections.

Copy link

github-actions bot commented Oct 8, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-10-08 11:36 UTC

Copy link

github-actions bot commented Oct 8, 2024

I found some issues in the code:

  1. In ChannelDetails.jsx:

    • There is a typo in the constant name CHANNNEL_DEACTIVATED_STATE. It should be CHANNEL_DEACTIVATED_STATE.
    • In the addDelegate function, there is a missing closing brace } at the end of the function.
    • There are missing closing braces } in the useEffect and useModalBlur hooks.
  2. In InitState.tsx:

    • In the checkUserForAlias function, there is a missing closing brace } after the else block inside the then function.

Fix these issues and the code should be good to go.

@rohitmalhotra1420 rohitmalhotra1420 merged commit 2ef95bc into main Oct 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants