Commit 65393806 authored by Tom Quirk's avatar Tom Quirk

Reset design scale when design changes

Fixes zoom bug
parent 32a796a9
...@@ -40,6 +40,8 @@ import { trackDesignDetailView } from '../../utils/tracking'; ...@@ -40,6 +40,8 @@ import { trackDesignDetailView } from '../../utils/tracking';
import { DESIGNS_ROUTE_NAME } from '../../router/constants'; import { DESIGNS_ROUTE_NAME } from '../../router/constants';
import { ACTIVE_DISCUSSION_SOURCE_TYPES } from '../../constants'; import { ACTIVE_DISCUSSION_SOURCE_TYPES } from '../../constants';
const DEFAULT_SCALE = 1;
export default { export default {
components: { components: {
ApolloMutation, ApolloMutation,
...@@ -65,7 +67,7 @@ export default { ...@@ -65,7 +67,7 @@ export default {
comment: '', comment: '',
annotationCoordinates: null, annotationCoordinates: null,
errorMessage: '', errorMessage: '',
scale: 1, scale: DEFAULT_SCALE,
resolvedDiscussionsExpanded: false, resolvedDiscussionsExpanded: false,
}; };
}, },
...@@ -157,6 +159,11 @@ export default { ...@@ -157,6 +159,11 @@ export default {
beforeDestroy() { beforeDestroy() {
Mousetrap.unbind('esc', this.closeDesign); Mousetrap.unbind('esc', this.closeDesign);
}, },
beforeRouteUpdate(to, from, next) {
// reset scale when the active design changes
this.scale = DEFAULT_SCALE;
next();
},
methods: { methods: {
addImageDiffNoteToStore( addImageDiffNoteToStore(
store, store,
......
---
title: Fix design scale bug when navigating to a design after zooming
merge_request: 44262
author:
type: fixed
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