Clean up unnecessary flag in `restoreHistory` function

refactor(router): clean up unnecessary flag in `restoreHistory` function (#43382)
Clean up unnecessary flag in `restoreHistory` functionrefactorclean unnecessary flag restorehistory function router

Committed by atscott

commit message
refactor(router): clean up unnecessary flag in `restoreHistory` function (#43382)

This restores the `finalize` function to directly call
`resetUrlToCurrentUrlTree`, as it was before efb440eb2f507f9a2675f2663f1af0b3c574c902.
This allows us to simplify the `restoreHistory` function because it no
longer needs to handle the call from `finalize` where it should not
reset the internal router state.
 
PR Close #43382

Editor assessment

Clean up unnecessary flag in restoreHistory function states the cleanup, and the body explains the restoration: finalize calls resetUrlToCurrentUrlTree directly again, as it did before a cited commit, so restoreHistory no longer needs the flag that suppressed state resets. That is a precise account of the removed conditional's history and purpose. The router scope and refactor type are accurate. Publishable. The restored call, the cited prior commit, and the removed flag form a complete history that justifies the simplification clearly.

Browse categories

More refactor examples · Back to search