Commit 8a39540a authored by Phil Hughes's avatar Phil Hughes

Use feature flags mixin to check the feature flag

parent dc668d68
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { escape } from 'lodash'; import { escape } from 'lodash';
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { hasDiff } from '~/helpers/diffs_helper'; import { hasDiff } from '~/helpers/diffs_helper';
...@@ -16,6 +17,7 @@ export default { ...@@ -16,6 +17,7 @@ export default {
DiffContent, DiffContent,
GlLoadingIcon, GlLoadingIcon,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
file: { file: {
type: Object, type: Object,
...@@ -92,7 +94,7 @@ export default { ...@@ -92,7 +94,7 @@ export default {
'file.file_hash': { 'file.file_hash': {
handler: function watchFileHash() { handler: function watchFileHash() {
if ( if (
window.gon?.features?.autoExpandCollapsedDiffs && this.glFeatures.autoExpandCollapsedDiffs &&
this.viewDiffsFileByFile && this.viewDiffsFileByFile &&
this.file.viewer.collapsed this.file.viewer.collapsed
) { ) {
...@@ -105,7 +107,7 @@ export default { ...@@ -105,7 +107,7 @@ export default {
immediate: true, immediate: true,
}, },
'file.viewer.collapsed': function setIsCollapsed(newVal) { 'file.viewer.collapsed': function setIsCollapsed(newVal) {
if (!this.viewDiffsFileByFile && !window.gon?.features?.autoExpandCollapsedDiffs) { if (!this.viewDiffsFileByFile && !this.glFeatures.autoExpandCollapsedDiffs) {
this.isCollapsed = newVal; this.isCollapsed = newVal;
} }
}, },
......
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