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

feat(multisig): Add feedbacks to creation form #1354

Merged
merged 9 commits into from
Nov 21, 2024
Merged

Conversation

WaDadidou
Copy link
Collaborator

@WaDadidou WaDadidou commented Nov 15, 2024

This PR add error feedbacks to the Multisig creation form. I added 2 try catch
It also add a loader to the PrimaryButton.

Existing errors

image

image

image

New errors

image

image

- Add invalidation cases
- Fix errors displaying for addresses
- Add loader for await getCosmosAccount usage
- Properly disable PrimaryButton
Copy link

netlify bot commented Nov 15, 2024

Deploy Preview for testitori ready!

Name Link
🔨 Latest commit e30148a
🔍 Latest deploy log https://app.netlify.com/sites/testitori/deploys/673e333b8d677600097b22f2
😎 Deploy Preview https://deploy-preview-1354--testitori.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 15, 2024

Deploy Preview for teritori-dapp ready!

Name Link
🔨 Latest commit e30148a
🔍 Latest deploy log https://app.netlify.com/sites/teritori-dapp/deploys/673e333b38beae0008fe5273
😎 Deploy Preview https://deploy-preview-1354--teritori-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@hthieu1110 hthieu1110 left a comment

Choose a reason for hiding this comment

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

Overall LGTM

Copy link
Collaborator

@n0izn0iz n0izn0iz left a comment

Choose a reason for hiding this comment

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

This introduces a bug when you don't change the Address #1 that is automatically injected, my guess it does not fetch the public key of this address

Screenshot 2024-11-15 at 08 45 20

(does not happen on master)

@n0izn0iz n0izn0iz changed the title Fix(multisig): Enhance the creation form feat(multisig): enhance the creation form Nov 15, 2024
@WaDadidou
Copy link
Collaborator Author

WaDadidou commented Nov 15, 2024

An issue:
When the form is valid, the PrimaryButton is still disabled, so the user has to manually modify an input to enable the button

Update: Fixed => 40f3c36

@WaDadidou
Copy link
Collaborator Author

WaDadidou commented Nov 15, 2024

This introduces a bug when you don't change the Address #1 that is automatically injected, my guess it does not fetch the public key of this address

Screenshot 2024-11-15 at 08 45 20 (does not happen on master)

Fixed => 40f3c36

packages/utils/errors.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@n0izn0iz n0izn0iz left a comment

Choose a reason for hiding this comment

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

it's very weird that we have a different behavior before and after the first submit attempt IMO

@WaDadidou WaDadidou requested a review from n0izn0iz November 18, 2024 22:52
@WaDadidou WaDadidou changed the title feat(multisig): enhance the creation form feat(multisig): Add feedbacks to creation form Nov 18, 2024
Comment on lines 138 to 143
setToast({
type: "error",
mode: "normal",
title: "Failed to create multisig",
message,
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do you add this? there is already a wrapWithFeedback around the submit call

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I forgot wrapWithFeedback.
7666d91

};

const onAddressChange = async (index: number, value: string) => {
const onValidate = async (index: number, value: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const onValidate = async (index: number, value: string) => {
const handleAddressChange = async (index: number, value: string) => {

nit: it doesn't do only validation but also get the pubkey, name could be misleading

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@n0izn0iz n0izn0iz left a comment

Choose a reason for hiding this comment

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

LGTM

@n0izn0iz n0izn0iz enabled auto-merge November 21, 2024 06:58
Copy link
Collaborator

@hthieu1110 hthieu1110 left a comment

Choose a reason for hiding this comment

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

LGTM

@n0izn0iz n0izn0iz added this pull request to the merge queue Nov 21, 2024
Merged via the queue into main with commit b9fd4e9 Nov 21, 2024
23 checks passed
@n0izn0iz n0izn0iz deleted the fix-multisig-form branch November 21, 2024 08:03
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