mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
When opening pgAdmin the layout should be auto reset if it is corrupted. Reset layout menu should work if layout is corrupted while using pgAdmin. #6266
This commit is contained in:
parent
72794f9524
commit
dc8832192d
@ -85,9 +85,9 @@ export default class MainMenuFactory {
|
||||
return new MenuItem({...options, callback: () => {
|
||||
// Some callbacks registered in 'callbacks' check and call specifiec callback function
|
||||
if (options.module && 'callbacks' in options.module && options.module.callbacks[options.callback]) {
|
||||
options.module.callbacks[options.callback].apply(options.module, [options.data, pgAdmin.Browser.tree.selected()]);
|
||||
options.module.callbacks[options.callback].apply(options.module, [options.data, pgAdmin.Browser.tree?.selected()]);
|
||||
} else if (options.module && options.module[options.callback]) {
|
||||
options.module[options.callback].apply(options.module, [options.data, pgAdmin.Browser.tree.selected()]);
|
||||
options.module[options.callback].apply(options.module, [options.data, pgAdmin.Browser.tree?.selected()]);
|
||||
} else if (options?.callback) {
|
||||
options.callback(options);
|
||||
} else {
|
||||
|
@ -62,8 +62,7 @@ _.extend(pgBrowser, {
|
||||
docker.restore(layout);
|
||||
if(checkLayout) {
|
||||
// Check restore layout is restored pgAdmin 4 layout successfully if not then reset layout to default pgAdmin 4 layout.
|
||||
let _panel = docker.findPanels('properties');
|
||||
if(_panel.length == 0 && defaultLayoutCallback){
|
||||
if((docker.findPanels('properties').length == 0 || docker.findPanels('browser').length == 0) && defaultLayoutCallback){
|
||||
// clear the wcDocker before reset layout.
|
||||
docker.clear();
|
||||
Notify.info(gettext('pgAdmin has reset the layout because the previously saved layout is invalid.'), null);
|
||||
|
Loading…
Reference in New Issue
Block a user