Skip to content

Commit

Permalink
when an object is changed, store the whole new object, not just the name
Browse files Browse the repository at this point in the history
  • Loading branch information
jvigliotta committed Dec 6, 2024
1 parent cd0be47 commit ab56384
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/ui/router/Browse.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ class Browse {
this.#openmct.layout.$refs.browseBar.viewKey = viewProvider.key;
}

#updateDocumentTitleOnNameMutation(newName) {
if (typeof newName === 'string' && newName !== document.title) {
document.title = newName;
this.#openmct.layout.$refs.browseBar.domainObject = {
...this.#openmct.layout.$refs.browseBar.domainObject,
name: newName
};
#handelBrowseObjectUpdate(newObject) {
this.#openmct.layout.$refs.browseBar.domainObject = newObject;

if (typeof newObject.name === 'string' && newObject.name !== document.title) {
document.title = newObject.name;
}
}

Expand Down Expand Up @@ -120,8 +118,8 @@ class Browse {
document.title = this.#browseObject.name; //change document title to current object in main view
this.#unobserve = this.#openmct.objects.observe(
this.#browseObject,
'name',
this.#updateDocumentTitleOnNameMutation.bind(this)
'*',
this.#handelBrowseObjectUpdate.bind(this)
);
const currentProvider = this.#openmct.objectViews.getByProviderKey(currentViewKey);
if (currentProvider && currentProvider.canView(this.#browseObject, this.#openmct.router.path)) {
Expand Down

0 comments on commit ab56384

Please sign in to comment.