diff --git a/docs/en_US/release_notes_7_4.rst b/docs/en_US/release_notes_7_4.rst index b64897e0d..7ee0c05f5 100644 --- a/docs/en_US/release_notes_7_4.rst +++ b/docs/en_US/release_notes_7_4.rst @@ -43,4 +43,5 @@ Bug fixes | `Issue #6363 `_ - Fixed an issue where preview images for themes were not loading. | `Issue #6420 `_ - Fix raise notice from func/proc or code blocks are no longer displayed live. | `Issue #6431 `_ - Fix an issue where PSQL is not working if the database name have quotes or double quotes. + | `Issue #6431 `_ - Fix an issue where all the menus are enabled when pgAdmin is opened and no object is selected in the object explorer. diff --git a/web/pgadmin/static/js/helpers/Menu.js b/web/pgadmin/static/js/helpers/Menu.js index b14eedd2b..98bd1e539 100644 --- a/web/pgadmin/static/js/helpers/Menu.js +++ b/web/pgadmin/static/js/helpers/Menu.js @@ -176,7 +176,7 @@ export class MenuItem { * Checks this menu enable/disable state based on the selection. */ disabled(node, item) { - if (this.enable == undefined || !node) { + if (this.enable == undefined) { return false; } @@ -192,12 +192,15 @@ export class MenuItem { } if (_.isBoolean(this.enable)) return !this.enable; - if (_.isFunction(this.enable)) { + if (_.isFunction(this.enable) && node) { return !this.enable.apply(this.module, [node, item, this.data]); } if (this.module && _.isBoolean(this.module[this.enable])) { return !this.module[this.enable]; } + if(!node) { + return true; + } if (this.module && _.isFunction(this.module[this.enable])) { return !(this.module[this.enable]).apply(this.module, [node, item, this.data]); }