Commit 421848db authored by Natalia Tepluhina's avatar Natalia Tepluhina Committed by Enrique Alcántara

Stop reusing design component on route change

- Fixed router spec
parent 11de0b1b
......@@ -156,6 +156,9 @@ export default {
},
mounted() {
Mousetrap.bind('esc', this.closeDesign);
this.trackEvent();
// We need to reset the active discussion when opening a new design
this.updateActiveDiscussion();
},
beforeDestroy() {
Mousetrap.unbind('esc', this.closeDesign);
......@@ -279,23 +282,6 @@ export default {
});
},
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.trackEvent();
});
},
beforeRouteUpdate(to, from, next) {
this.trackEvent();
this.closeCommentForm();
// We need to reset the active discussion when opening a new design
this.updateActiveDiscussion();
next();
},
beforeRouteLeave(to, from, next) {
// We need to reset the active discussion when moving to design list view
this.updateActiveDiscussion();
next();
},
createImageDiffNoteMutation,
DESIGNS_ROUTE_NAME,
};
......
......@@ -318,6 +318,6 @@ export default {
</li>
</ol>
</div>
<router-view />
<router-view :key="$route.fullPath" />
</div>
</template>
......@@ -33,6 +33,7 @@ function factory(routeArg) {
design: { loading: true },
permissions: { loading: true },
},
mutate: jest.fn(),
},
},
});
......
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