(Feature) - Expanded decoded data collapses automatically#1731
(Feature) - Expanded decoded data collapses automatically#1731dasanra merged 14 commits intodevelopmentfrom
Conversation
Improves how updateSafe is dispatched within checkAndUpdateSafe to avoid unnecessary re renders
|
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Checked that the "Actions" display doesn't closes with the new rendering of the table Looks good to me |
…to expanded-decoded-data-collapses-automatically
|
Travis automatic deployment: |
|
Travis automatic deployment: |
src/utils/arrays.ts
Outdated
|
|
||
| return array1 | ||
| ? array1.every((element, index) => { | ||
| return array2 ? element === array2[index] : false |
There was a problem hiding this comment.
you're assuming this as an array of a subset of primitives, isn't it?
I mean, if you compare two objects it will give false. Maybe narrowing the type would help.
So far, instead of unknown[] you can go with something around type ComparablePrimitives = string | boolean | number and array1?: ComparablePrimitives[] | null?
not sure at all about the names, but something around that.
There was a problem hiding this comment.
as I comment before, I think we should use this: https://lodash.com/docs/4.17.15#isEqual it's pretty well tested.
There was a problem hiding this comment.
I replaced it with lodash as @nicosampler suggested
|
Travis automatic deployment: |
|
Travis automatic deployment: |
1 similar comment
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
Closes #1693 by:
shouldSafeStoreBeUpdatedwithinUPDATE_SAFEreducer to avoid updating the safe in the case that the values didn't changed which would fire unnecessary renders of the entire app. This happens because most of the values of thesafeobject are arrays or nested objects that could be the same but the reference is different and it's treated as a different valuecheckAndUpdateSafeavoids addingfeaturesEnabledif the array didn't changedHow it was before:
How it's now: