mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Reset the layout if pgAdmin4 detects the layout is in an inconsistent state. Fixes #6988
This commit is contained in:
committed by
Akshay Joshi
parent
d4bf7164f9
commit
8bf178b0a3
@@ -61,6 +61,25 @@ _.extend(pgBrowser, {
|
||||
if (layout != '') {
|
||||
try {
|
||||
docker.restore(layout);
|
||||
// Check restore layout is restored pgAdmin 4 layout successfully if not then reset layout to default pgAdmin 4 layout.
|
||||
var reset_layout_to_default = true;
|
||||
for (const [key, value] of Object.entries(this.panels)) {
|
||||
if(value.name !== 'browser' || key !== 'browser') {
|
||||
var _panel = docker.findPanels(value.name);
|
||||
if(_panel.length > 0){
|
||||
reset_layout_to_default = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(reset_layout_to_default && defaultLayoutCallback) {
|
||||
// clear the wcDocker before reset layout.
|
||||
docker.clear();
|
||||
Alertify.info(gettext('pgAdmin has detected some issues with the UI layout, so reset it to the default.'), 0);
|
||||
if(defaultLayoutCallback){
|
||||
defaultLayoutCallback(docker);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
docker.clear();
|
||||
|
||||
Reference in New Issue
Block a user