Skip to content

Commit 5232432

Browse files
authored
Merge pull request #1044 from nscuro/backport-pr-1032
Backport: Fix state of sidebar not being saved for non-`SNAPSHOT` versions
2 parents 1bff520 + e830d5d commit 5232432

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

src/containers/DefaultContainer.vue

+17-20
Original file line numberDiff line numberDiff line change
@@ -202,29 +202,26 @@ export default {
202202
mounted() {
203203
if (this.$dtrack && this.$dtrack.version.includes('SNAPSHOT')) {
204204
this.$root.$emit('bv::show::modal', 'snapshotModal');
205+
}
205206
206-
this.isSidebarMinimized =
207-
localStorage && localStorage.getItem('isSidebarMinimized') !== null
208-
? localStorage.getItem('isSidebarMinimized') === 'true'
209-
: false;
210-
const sidebar = document.body;
211-
if (sidebar) {
212-
if (this.isSidebarMinimized) {
213-
sidebar.classList.add('sidebar-minimized');
214-
} else {
215-
sidebar.classList.remove('sidebar-minimized');
216-
}
207+
this.isSidebarMinimized =
208+
localStorage && localStorage.getItem('isSidebarMinimized') !== null
209+
? localStorage.getItem('isSidebarMinimized') === 'true'
210+
: false;
211+
const sidebar = document.body;
212+
if (sidebar) {
213+
if (this.isSidebarMinimized) {
214+
sidebar.classList.add('sidebar-minimized');
215+
} else {
216+
sidebar.classList.remove('sidebar-minimized');
217217
}
218-
this.$nextTick(() => {
219-
const sidebarMinimizer = this.$el.querySelector('.sidebar-minimizer');
220-
if (sidebarMinimizer) {
221-
sidebarMinimizer.addEventListener(
222-
'click',
223-
this.handleMinimizedUpdate,
224-
);
225-
}
226-
});
227218
}
219+
this.$nextTick(() => {
220+
const sidebarMinimizer = this.$el.querySelector('.sidebar-minimizer');
221+
if (sidebarMinimizer) {
222+
sidebarMinimizer.addEventListener('click', this.handleMinimizedUpdate);
223+
}
224+
});
228225
},
229226
computed: {
230227
name() {

0 commit comments

Comments
 (0)