You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix($state): reloadOnSearch should not affect non-search param changes.
The handling of `reloadOnSearch: false` caused ui-router to avoid
reloading the state in more cases than it should. The designed and
documented behavior of this flag is to avoid state reload when the
URL search string changes. It was also avoiding state reload when
the URL path (or any non-search parameters to the state) changed,
and even when state reload was explicitly requested.
This change
- flips the name of shouldTriggerReload (and the accompanying guard
boolean, skipTriggerReloadCheck) to match the direction of the
logic: shouldSkipReload and allowSkipReloadCheck
- teaches shouldSkipReload to look at the types of the differing
parameters, and only skip the reload if the only parameters that
differ were search parameters
- pulls the test for options.reload to the front of the complex
boolean expression. (I think calling $state.reload() explicitly
should reload a state even if it has reloadOnSearch:false. But I
don't understand exactly why the test for this was where it was, and
maybe there's a good reason I'm missing. Also, if the behavior I
favor is deemed correct, we could also achieve that by setting
allowSkipReloadCheck=false for all truthy values of options.reload,
namely, if options.reload===true, and then shouldSkipReload wouldn't
even need to look at options. I left a comment about this in the
source too and would appreciate feedback.)
Fixesangular-ui#1079. Helps with one of the cases broken in angular-ui#582.
0 commit comments