fragment: prevent redundant navigation
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/888/head
parent
e4e13459aa
commit
1f7602c8c6
|
@ -193,12 +193,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
// Only contextual fragments should be present on page load
|
||||
if (fragment.list.length) {
|
||||
const contextual = fragment.list.filter((frag) => frag.type === FragmentType.viewer);
|
||||
const hash = encodeFragment(contextual);
|
||||
if (hash !== _m.route.hash) {
|
||||
_m.router.replace({
|
||||
path: _m.route.path,
|
||||
query: _m.route.query,
|
||||
hash: encodeFragment(contextual),
|
||||
hash: hash,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger when route changes; notify listeners of popped fragments.
|
||||
|
|
Loading…
Reference in New Issue