pgBrowser tree does not need to save tree state, when 'browser' module

is initialized from the tools like query editor, debugger, etc.

Refs #3559
This commit is contained in:
Ashesh Vashi 2019-01-02 10:45:17 +05:30
parent 41c028f944
commit 1b9c841c15

View File

@ -1970,7 +1970,8 @@ define('pgadmin.browser', [
}
$(window).on('beforeunload', function() {
if (pgBrowser.get_preference('browser', 'browser_tree_state_save_interval').value !== -1)
let pref = pgBrowser.get_preference('browser', 'browser_tree_state_save_interval');
if (!_.isUndefined(pref) && pref.value !== -1)
pgAdmin.Browser.browserTreeState.save_state();
});