mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Navigation] Fix errors appearing in console on initial navigation. Fixes #1351
This commit is contained in:
parent
45de84c183
commit
83ed4f6b0d
@ -52,7 +52,7 @@ define(
|
||||
var currentIds = $route.current.params.ids;
|
||||
|
||||
$scope.treeModel = {
|
||||
selectedObject: {}
|
||||
selectedObject: undefined
|
||||
};
|
||||
|
||||
function idsForObject(domainObject) {
|
||||
@ -139,7 +139,11 @@ define(
|
||||
|
||||
// Also listen for changes which come from the tree. Changes in
|
||||
// the tree will trigger a change in browse navigation state.
|
||||
$scope.$watch("treeModel.selectedObject", navigateDirectlyToModel);
|
||||
$scope.$watch("treeModel.selectedObject", function (newObject, oldObject) {
|
||||
if (oldObject !== newObject) {
|
||||
navigateDirectlyToModel(newObject);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Listen for route changes which are caused by browser events
|
||||
|
Loading…
x
Reference in New Issue
Block a user