mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed minor issue in saving tree state logic.
This commit is contained in:
parent
55cf0cf2f9
commit
235a75202d
@ -286,11 +286,13 @@ _.extend(pgBrowser.browserTreeState, {
|
|||||||
let databaseItem = treeHierarchy['database']['id'],
|
let databaseItem = treeHierarchy['database']['id'],
|
||||||
topParent = treeHierarchy && treeHierarchy[this.parent]['_id'];
|
topParent = treeHierarchy && treeHierarchy[this.parent]['_id'];
|
||||||
|
|
||||||
if (treeHierarchy['database'].connected) {
|
if (topParent in this.current_state && 'selected' in this.current_state[topParent]) {
|
||||||
this.current_state[topParent]['conn_status'][databaseItem] = 1;
|
if (treeHierarchy['database'].connected) {
|
||||||
}
|
this.current_state[topParent]['conn_status'][databaseItem] = 1;
|
||||||
else {
|
}
|
||||||
this.current_state[topParent]['conn_status'][databaseItem] = 0;
|
else {
|
||||||
|
this.current_state[topParent]['conn_status'][databaseItem] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -302,7 +304,8 @@ _.extend(pgBrowser.browserTreeState, {
|
|||||||
|
|
||||||
selectedItem = selectedItem ? selectedItem.id : undefined;
|
selectedItem = selectedItem ? selectedItem.id : undefined;
|
||||||
|
|
||||||
if (!_.isUndefined(selectedItem)) {
|
if (topParent in this.current_state && 'selected' in this.current_state[topParent]
|
||||||
|
&& !_.isUndefined(selectedItem)) {
|
||||||
this.current_state[topParent]['selected'][treeHierarchy[this.parent]['id']] = selectedItem;
|
this.current_state[topParent]['selected'][treeHierarchy[this.parent]['id']] = selectedItem;
|
||||||
this.current_state[topParent]['selected'][databaseItem] = selectedItem;
|
this.current_state[topParent]['selected'][databaseItem] = selectedItem;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user