1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/app
Mark Stacey 46d72d17a9
Correctly detect changes to background state (#8435)
Changes to the background state were being detected in the `update`
event handler in `ui/index.js` that receives state updates from the
background. However this doesn't catch every update; some state
changes are received by the UI in-between these `update` events.

The background `getState` function is callable directly from the UI,
and many action creators call it via `forceUpdateMetamaskState` to
update the `metamask` state immediately without waiting for the next
`update` event. These state updates skip this change detection in
`ui/index.js`.

For example, if a 3Box state restoration resulted in a `currentLocale`
change, and then a `forceUpdateMetamaskState` call completed before the
next `update `event was received, then `updateCurrentLocale` wouldn't
be called, and the `locale` store would not be updated correctly with
the localized messages for the new locale.

We now check for background state changes in the `updateMetamaskState`
action creator. All `metamask` state updates go through this function,
so we aren't missing any changes anymore.
2020-04-28 10:40:28 -03:00
..
components Delete Dai/Sai migration notification (#8418) 2020-04-27 16:23:43 -02:30
contexts Migrate "i18n-provider" to new context API (#8213) 2020-03-23 14:07:05 -03:00
css Remove unused ShapeShift components (#8402) 2020-04-24 12:33:24 -03:00
ducks Remove unused transForward state and actions (#8401) 2020-04-23 20:32:08 -03:00
helpers Fix connected sites modal styling; add shortenUrl function (#8409) 2020-04-27 08:36:08 -07:00
pages Delete Dai/Sai migration notification (#8418) 2020-04-27 16:23:43 -02:30
selectors Delete Dai/Sai migration notification (#8418) 2020-04-27 16:23:43 -02:30
store Correctly detect changes to background state (#8435) 2020-04-28 10:40:28 -03:00