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

(Fix) "Approve transaction" modal closes#1477

Merged
fernandomg merged 2 commits intofeature/#1353-xDai-compatibilityfrom
fix/#1474-approve-tx-modal-closes
Oct 15, 2020
Merged

(Fix) "Approve transaction" modal closes#1477
fernandomg merged 2 commits intofeature/#1353-xDai-compatibilityfrom
fix/#1474-approve-tx-modal-closes

Conversation

@fernandomg
Copy link
Contributor

This PR closes #1474, by:

  • adding an equality function to the useAction hook for the featuresEnabled selector

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Oct 14, 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 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Oct 14, 2020

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

@francovenica francovenica self-requested a review October 14, 2020 21:00
Copy link
Contributor

@francovenica francovenica left a comment

Choose a reason for hiding this comment

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

Works fine. The modal is not closing itself anymore

@fernandomg fernandomg changed the title (Fix) Approve transaction modal closes (Fix) "Approve transaction" modal closes Oct 14, 2020
const TxsTable = React.lazy(() => import('src/routes/safe/components/Transactions/TxsTable'))
const AddressBookTable = React.lazy(() => import('src/routes/safe/components/AddressBook'))

const featuresEqualityFn = (left, right) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm... why does it not complain about the types? :P

Also, I think It could be a generic util function, not only featuresEquality

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, even a better solution would be removing enabledFeatures from the redux store... It can be computed only with a version number, doesn't have to be stored.

Copy link
Contributor

@nicosampler nicosampler Oct 15, 2020

Choose a reason for hiding this comment

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

agreed. But let's do it in a different PR once xDai is merged. I created this ticket #1479 to remove it from the store.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why? It's not a huge change. The amount of tech debt tickets we have is pretty high (and there's a ton of discussed, but not created ones), so I'd think before adding a new one

Copy link
Contributor

@mmv08 mmv08 Oct 15, 2020

Choose a reason for hiding this comment

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

  const featuresEnabled = useMemo(() => enabledFeatures(safe.version), [safe.version])

literally, that's it, except for removing the calculation in fetchSafe.ts, updating types, and replacing 2 references to the selector with a function from above. It's around 10 mins of work.

Copy link
Contributor

@nicosampler nicosampler Oct 15, 2020

Choose a reason for hiding this comment

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

the thing is we need to release xDai on Monday. So Franco needs to test everything on xDAi and do a regression on Mainnet ASAP. I understand your point, but I would suggest working on it on Monday if everything goes well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

- I left the inline equalityFn, as an ad-hoc solution.
First, because we're going to remove this when #1479 is done
Second, because this way it infers the types defined in the useSelector generics
@fernandomg fernandomg requested a review from mmv08 October 15, 2020 14:57
@ghost
Copy link

ghost commented Oct 15, 2020

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

@fernandomg fernandomg merged commit 3dcf27e into feature/#1353-xDai-compatibility Oct 15, 2020
@fernandomg fernandomg deleted the fix/#1474-approve-tx-modal-closes branch October 15, 2020 17:19
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 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.

5 participants