Skip to content

Commit 24d3a12

Browse files
committed
Closes #8310
- Format and pass properly constructed current-view to ViewSwitcher, based on BrowseBar.vue.
1 parent e5120e9 commit 24d3a12

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/ui/preview/PreviewContainer.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div role="dialog" aria-label="Preview Container" class="l-preview-window js-preview-window">
2424
<PreviewHeader
2525
ref="previewHeader"
26-
:current-view="view"
26+
:current-view="currentView"
2727
:domain-object="domainObject"
2828
:views="viewProviders"
2929
/>
@@ -65,13 +65,19 @@ export default {
6565
domainObject: domainObject,
6666
viewKey: null,
6767
view: null,
68-
viewProviders: [],
6968
currentViewProvider: {},
7069
existingViewIndex: 0
7170
};
7271
},
72+
computed: {
73+
viewProviders() {
74+
return this.openmct.objectViews.get(this.domainObject, this.objectPath) || [];
75+
},
76+
currentView() {
77+
return this.viewProviders?.find((provider) => provider.key === this.viewKey) || {};
78+
}
79+
},
7380
mounted() {
74-
this.viewProviders = this.openmct.objectViews.get(this.domainObject, this.objectPath);
7581
this.viewProviders.forEach((provider, index) => {
7682
provider.onItemClicked = () => {
7783
if (this.existingView && provider.key === this.existingView.key) {

0 commit comments

Comments
 (0)