fragment: remove non-contextual fragments on start
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/888/head
parent
cf3b782cec
commit
f44ac76c58
|
@ -190,6 +190,16 @@ export const fragment = {
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
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);
|
||||||
|
_m.router.replace({
|
||||||
|
path: _m.route.path,
|
||||||
|
query: _m.route.query,
|
||||||
|
hash: encodeFragment(contextual),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger when route changes; notify listeners of popped fragments.
|
* Trigger when route changes; notify listeners of popped fragments.
|
||||||
* @param to Switching to this route
|
* @param to Switching to this route
|
||||||
|
|
Loading…
Reference in New Issue