From 298c4f20a9ec5099953f57f3233e51d1c53d159f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milorad=20FIlipovi=C4=87?= Date: Wed, 12 Oct 2022 18:18:06 +0200 Subject: [PATCH] fix(editor): fix for menu collapse lag when loading a credentials page (#4329) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐛 Fixing a menu collapse bug on credentials view --- packages/editor-ui/src/components/MainSidebar.vue | 7 +++---- packages/editor-ui/src/modules/ui.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index eaf85a60f0..6943a557bb 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -281,9 +281,6 @@ export default mixins( if (this.$refs.user) { this.$externalHooks().run('mainSidebar.mounted', { userRef: this.$refs.user }); } - if (window.innerWidth > 900 && !this.isNodeView) { - this.$store.commit('ui/expandSidebarMenu'); - } this.checkWidthAndAdjustSidebar(window.innerWidth); await Vue.nextTick(); this.fullyExpanded = !this.isCollapsed; @@ -457,8 +454,10 @@ export default mixins( this.checkWidthAndAdjustSidebar(browserWidth); }, checkWidthAndAdjustSidebar (width: number) { - if (width < 900) { + if (width < 900 || this.isNodeView) { this.$store.commit('ui/collapseSidebarMenu'); + } else { + this.$store.commit('ui/expandSidebarMenu'); } }, }, diff --git a/packages/editor-ui/src/modules/ui.ts b/packages/editor-ui/src/modules/ui.ts index 53ac6f76d3..067ad21693 100644 --- a/packages/editor-ui/src/modules/ui.ts +++ b/packages/editor-ui/src/modules/ui.ts @@ -110,7 +110,7 @@ const module: Module = { }, }, modalStack: [], - sidebarMenuCollapsed: true, + sidebarMenuCollapsed: false, isPageLoading: true, currentView: '', mainPanelDimensions: {},