Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

(Fix) - #1605 QR Input address fix#1612

Merged
Agupane merged 10 commits intodevelopmentfrom
fix/1605-qr-input-address-fix
Nov 19, 2020
Merged

(Fix) - #1605 QR Input address fix#1612
Agupane merged 10 commits intodevelopmentfrom
fix/1605-qr-input-address-fix

Conversation

@Agupane
Copy link
Contributor

@Agupane Agupane commented Nov 16, 2020

Closes #1605
Closes #1196 by:

  • Adding types
  • Fixing how the. useEffect hook was being used for opening/closing the modal

@Agupane Agupane self-assigned this Nov 16, 2020
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@Agupane Agupane requested a review from francovenica November 16, 2020 18:31
@github-actions
Copy link

github-actions bot commented Nov 16, 2020

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 7 0
Ignored 0 N/A
  • Result: ✅ success

  • Annotations: 7 total


[warning] @typescript-eslint/explicit-module-boundary-types

Require explicit return and argument types on exported functions' and classes' public class methods


Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Nov 16, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 16, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

Copy link
Contributor

@fernandomg fernandomg left a comment

Choose a reason for hiding this comment

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

#1196 's point 2. is not fixed. I still have the image selector popping up again, and the image is not being processed.

qr-upload

Maybe it would be better to let that fix for another PR and focus on the #1605 here.

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

1 similar comment
@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

@Agupane
Copy link
Contributor Author

Agupane commented Nov 17, 2020

#1196 's point 2. is not fixed. I still have the image selector popping up again, and the image is not being processed.

qr-upload

Maybe it would be better to let that fix for another PR and focus on the #1605 here.

I tested it and seems that the problem is that the qr scanner cannot read the qr but instead of throwing an error it just open the modal again, I added an error text for those cases and remove the auto poping:

qr-upload

@Agupane Agupane requested a review from fernandomg November 17, 2020 15:15
@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

openImageDialog()
}
}, [hasWebcam, openImageDialog])
}, [useWebcam, openImageDialog, fileUploadModalOpen, setFileUploadModalOpen, error])
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is not needed in dependencies setFileUploadModalOpen. But not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not 100% needed but it's a bad react practice not adding all the things used on the useEffect

console.error('Error uploading file', error)
setError(`The QR could not be read`)
}
if (!useWebcam) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this validation needed? seems like if useWebcam is null or false, it will never reach this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes because if it's false means that the user opened the modal for uploading the file and if that line was reached that means that there was not an error but the qr could not be readed (it returns null or successData) and we need to display a feedback in that case

Copy link
Contributor

@nicosampler nicosampler left a comment

Choose a reason for hiding this comment

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

LGTM.
I just left a few comments!

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 17, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

@francovenica
Copy link
Contributor

Tested here:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x9913B9180C20C6b0F21B6480c84422F6ebc4B808/balances

The recipient field not being filled with the contract's address was fixed
The file selector window opening over and over doesn't happen anymore
If a wrong QR image is being uploaded a message indicating such error is displayed
Checked that the address validation still works (loading a MM account as a Safe won't work for example)

It looks good to me

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

@ghost
Copy link

ghost commented Nov 18, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 19, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/rinkeby/app

@ghost
Copy link

ghost commented Nov 19, 2020

Travis automatic deployment:
https://pr1612--safereact.review.gnosisdev.com/volta/app

@Agupane Agupane merged commit e482d32 into development Nov 19, 2020
@Agupane Agupane deleted the fix/1605-qr-input-address-fix branch November 19, 2020 15:22
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contract Interaction - QR won't input the contract address in the recipient field QR code for recipient input

5 participants