diff --git a/ui/src/components/inputs/EditorView.vue b/ui/src/components/inputs/EditorView.vue index 97cca853bd..6e1c0b0f0f 100644 --- a/ui/src/components/inputs/EditorView.vue +++ b/ui/src/components/inputs/EditorView.vue @@ -587,10 +587,8 @@ timer.value = setTimeout(() => onEdit(event, isFlow), 500); }; - const switchViewType = (event, shouldPersist = true) => { - if(shouldPersist) persistViewType(event) - else viewType.value = event - + const switchViewType = (event) => { + persistViewType(event); if ( [editorViewTypes.TOPOLOGY, editorViewTypes.SOURCE_TOPOLOGY].includes( viewType.value @@ -881,13 +879,7 @@ return tab.name === currentTab.value.name; } - watch(currentTab, (current, previous) => { - const isCurrentFlow = current?.name === "Flow"; - const isPreviousFlow = previous?.name === "Flow"; - - if(isPreviousFlow) persistViewType(viewType.value); - switchViewType(isCurrentFlow ? loadViewType() : editorViewTypes.SOURCE, false) - + watch(currentTab, () => { nextTick(() => { const activeTabElement = tabsScrollRef.value.wrapRef.querySelector(".tab-active"); const rightMostCurrentTabPixel = activeTabElement.offsetLeft + activeTabElement.clientWidth; diff --git a/ui/src/components/inputs/SwitchView.vue b/ui/src/components/inputs/SwitchView.vue index 3e4f528eb5..f27697709f 100644 --- a/ui/src/components/inputs/SwitchView.vue +++ b/ui/src/components/inputs/SwitchView.vue @@ -3,17 +3,17 @@ - - + + - - + + - - + + - - + + @@ -28,7 +28,7 @@