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

Snap Wallet Address issue fixed #1377

Merged

Conversation

abhishek-01k
Copy link
Collaborator

What to Review:

In the /snap route:

  1. Install Snap and then add your wallet address. In settings see if you can see your wallet address.
    2.Uninstall Snap and then again try to install Snap. In this process, You will directly see the settings button and Connect with metamask button will be skipped.

@abhishek-01k abhishek-01k requested a review from arn4b January 11, 2024 11:51
@abhishek-01k abhishek-01k linked an issue Jan 11, 2024 that may be closed by this pull request
Copy link

File: src/components/PushSnap/PushSnapConfigureModal.tsx

  1. Line 29: The code setToggleStatus(res); should be wrapped inside an if statement to make sure that the res value is not undefined before setting the toggleStatus state. Otherwise, it may throw an error.

  2. Line 38: The code block for getSignature function is missing an else statement. It should handle the case when mode is neither 1 nor 2.

  3. Line 45: The code ; is missing at the end of the if block in the getSignature function.

  4. Line 70: The closing parenthesis for the addWalletAddresses function is missing.

  5. Line 88: The closing parenthesis for the handleChange function is missing.

  6. Line 89: The closing curly brace for the HandleChange function is missing.

  7. Line 100: A closing paranthesis ')' is missing at the end of the removeWalletAddresses function.

  8. Line 103: The opening curly brace for the getWalletAddresses function is missing.

  9. Line 136: The closing paranthesis ')' for the window.ethereum?.request function is missing.

  10. Line 140: The closing single quotation mark for the shortenText function is missing.

  11. Line 150: The opening curly brace for the handleWalletSelect function is missing.

  12. Line 179: The opening curly brace for the useTheme hook is missing.

  13. Line 272: The closing paranthesis ')' for the getInstalledSnaps function is missing.

  14. Line 289: The closing paranthesis ')' for the window.ethereum?.request function is missing.

  15. Line 314: The opening curly brace for the connectSnap function is missing.

  16. Line 319: The opening curly brace for the addwalletAddress function is missing.

  17. Line 322: The opening curly brace for the getSignature function is missing.

  18. Line 360: The closing paranthesis ')' for the connectToMetaMask function is missing.

  19. Line 384: The closing paranthesis ')' for the getSignature function is missing.

  20. Line 422: The closing paranthesis ')' for the LoaderSpinner component is missing.

  21. Line 424: The opening curly brace for the ConnectButton component is missing.

  22. Line 425: The closing paranthesis ')' for the ConnectButton component is missing.

  23. Line 452: The closing paranthesis ')' for the SnapModule component is missing.

File: src/modules/snap/SnapModule.tsx

  1. Line 43: The closing paranthesis ')' for the getInstalledSnaps function is missing.

  2. Line 66: The closing paranthesis ')' for the window.ethereum?.request function is missing.

  3. Line 80: The closing paranthesis ')' for the window.ethereum?.request function is missing.

  4. Line 92: The opening curly brace for the connectSnap function is missing.

  5. Line 111: The opening curly brace for the connectToMetaMask function is missing.

  6. Line 115: The closing curly brace for the try block in the connectToMetaMask function is missing.

  7. Line 118: The closing paranthesis ')' for the setWalletConnected function is missing.

  8. Line 119: The closing paranthesis ')' for the setLoading function is missing.

  9. Line 123: The closing paranthesis ')' for the catch block in the connectToMetaMask function is missing.

  10. Line 128: The opening curly brace for the getSignature function is missing.

  11. Line 152: The closing paranthesis ')' for the React.useContext function is missing.

  12. Line 185: The closing paranthesis ')' for the ConnectButton component is missing.

  13. Line 202: The closing paranthesis ')' for the SnapModule component is missing.

Copy link
Contributor

@arn4b arn4b left a comment

Choose a reason for hiding this comment

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

LGTM

@abhishek-01k abhishek-01k merged commit a85d895 into Snap-Flow-and-Recieve-Notifications-fix Jan 11, 2024
1 check passed
Copy link

File: src/components/PushSnap/PushSnapConfigureModal.tsx

  1. In the getSignature(mode: number) function, the if statements comparing mode should use triple equals (===) instead of double equals (==) for strict equality comparison. Update if (mode == 1) to if (mode === 1) and if (mode == 2) to if (mode === 2).

  2. In the getSignature(mode: number) function, the second condition is missing an await keyword before signer.signMessage. Add await before signer.signMessage to properly wait for the signature.

  3. In the addWalletAddresses function, the condition if (searchedUser) should be placed outside the signatureResult check. Move the closing brace (}) after console.log('Signature Validation Failed'); outside the if (signatureResult) block.

  4. The handleChange function is missing a closing brace (}) after setToggleStatus(0);.

  5. The removeWalletAddresses function is missing a closing brace (}) after console.log("Ran",signatureResult).

  6. In the getWalletAddresses function, the line setAddresses(result); should be placed inside the then block of the await statement.

  7. In the useClickAway hook, the setShowRemove(null); statement should be placed inside the callback function.

  8. In the handleWalletSelect function, the line setWalletSelected(address); should have a type annotation for the address parameter, like address: string.

  9. The AddressesContainer styled component is missing closing braces (}) for the ::-webkit-scrollbar and ::-webkit-scrollbar-thumb pseudo-elements.

  10. The AddressesSubContainer styled component is missing a closing brace (}) after justify-content: space-between;.

  11. The MoreOptions styled component is missing a closing brace (}) after cursor: pointer;.

  12. The RemoveDiv styled component is missing a closing brace (}) after top: 3px;.

File: src/modules/snap/SnapModule.tsx

  1. The getInstalledSnaps function is missing a closing brace (}) after setSnapInstalled(true);.

  2. In the getWalletAddresses function, the if (result.includes(account)) condition is missing a closing brace (}) after setAddedAddress(false);.

  3. In the connectToMetaMask function, the setLoading(false); statement should be placed after the catch block.

  4. The getSignature function is missing a closing brace (}) after return signature;.

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.

🐛 [BUG] - Error while trying to add wallet address to Snaps
2 participants