Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip action_sheet: Fix use of stale context; TODO is this real?
On hot reload, the `DesignVariables.of(context)` lookup in this builder could throw because `context` was no longer mounted. (I'm not sure if the issue could also be triggered in release builds.) ... Well, in any case this came up when doing hot reload while in the emoji picker, from 1103. But then even after this change, a very similar symptom continued, just not at this line. I also don't have a great theory for how it was happening in the first place. The symptom didn't seem to always happen. I think it may have been connected to when the per-account store got replaced -- as a consequence not actually of the hot reload, but of coming back online after having the device asleep for a while as I edited the code. If that is the trigger, then it may affect real users. OTOH I still don't have a great theory for how it would cause the context to no longer be mounted -- the whole point of PerAccountStoreAwareStateMixin is that all the elements and state get to stay in place while the PerAccountStore itself is replaced.
- Loading branch information