mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-17 16:34:44 -05:00
refreshMenus() rebuilt the application menu from the module-level cachedMenus, which is only populated once the renderer sends its menu definition via the 'setMenus' IPC. When a menu refresh was triggered before that happened - e.g. an auto-update event, or the user closing the window while the UI was still loading - cachedMenus was undefined and bindMenuClicks() crashed with 'Cannot read properties of undefined (reading map)', surfacing as an uncaught-exception dialog. Guard refreshMenus() so it bails out when there are no cached menus to rebuild. Closes #9762
This commit is contained in:
@@ -43,6 +43,7 @@ Bug fixes
|
||||
| `Issue #6308 <https://github.com/pgadmin-org/pgadmin4/issues/6308>`_ - Fix the infinite loading spinner after an idle database connection is silently dropped, by detecting stale connections and offering a reconnect dialog.
|
||||
| `Issue #9595 <https://github.com/pgadmin-org/pgadmin4/issues/9595>`_ - Fix missing ALTER ... SET DEFAULT statements for inherited columns in the generated table SQL/EDIT script.
|
||||
| `Issue #9677 <https://github.com/pgadmin-org/pgadmin4/issues/9677>`_ - Fix the Unlogged table toggle in table properties not generating any ALTER TABLE ... SET LOGGED/UNLOGGED statement.
|
||||
| `Issue #9762 <https://github.com/pgadmin-org/pgadmin4/issues/9762>`_ - Fix the "Cannot read properties of undefined (reading 'map')" crash in the desktop runtime when a menu refresh is triggered before the application menus have been received.
|
||||
| `Issue #9828 <https://github.com/pgadmin-org/pgadmin4/issues/9828>`_ - Fix tool calls failing against OpenAI-compatible providers that emit empty/null name, arguments, or id fields in streaming continuation deltas.
|
||||
| `Issue #9875 <https://github.com/pgadmin-org/pgadmin4/issues/9875>`_ - Fixed an issue where EXPLAIN and EXPLAIN ANALYZE failed to execute when blank lines separated clauses in the SQL query.
|
||||
| `Issue #9810 <https://github.com/pgadmin-org/pgadmin4/issues/9810>`_ - Use the ServerManager's passfile for the credential gate in connect() so the check matches the passfile actually used for the connection, and warn on conflicting passfile/passexec settings.
|
||||
|
||||
@@ -190,6 +190,12 @@ function buildAndSetMenus(menus, pgAdminMainScreen, configStore, callbacks={}) {
|
||||
}
|
||||
|
||||
export function refreshMenus(pgAdminMainScreen, configStore, callbacks={}) {
|
||||
// cachedMenus is only populated once the renderer sends its menu definition
|
||||
// via the 'setMenus' IPC. A refresh can be triggered before that happens
|
||||
// (e.g. an auto-update event, or the window being closed while the UI is
|
||||
// still loading). In that case there are no menus to rebuild, so bail out
|
||||
// to avoid dereferencing an undefined menu list.
|
||||
if (!cachedMenus) return;
|
||||
buildAndSetMenus(cachedMenus, pgAdminMainScreen, configStore, callbacks);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user