Commit 86c680a2 authored by Paul Slaughter's avatar Paul Slaughter Committed by Jose Vargas

Only update Vue router if changed

It looke like this now throws an error when
`router.push(...)` is called with current path.
parent 69e4c524
...@@ -17,9 +17,13 @@ describe('~/ide/sync_router_and_store', () => { ...@@ -17,9 +17,13 @@ describe('~/ide/sync_router_and_store', () => {
const getRouterCurrentPath = () => router.currentRoute.fullPath; const getRouterCurrentPath = () => router.currentRoute.fullPath;
const getStoreCurrentPath = () => store.state.router.fullPath; const getStoreCurrentPath = () => store.state.router.fullPath;
const updateRouter = path => { const updateRouter = async path => {
if (getRouterCurrentPath() === path) {
return;
}
router.push(path); router.push(path);
return waitForPromises(); await waitForPromises();
}; };
const updateStore = path => { const updateStore = path => {
store.dispatch('router/push', path); store.dispatch('router/push', path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment