MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / refreshMenus

Function refreshMenus

runtime/src/js/menu.js:192–200  ·  view source on GitHub ↗
(pgAdminMainScreen, configStore, callbacks={})

Source from the content-addressed store, hash-verified

190}
191
192export function refreshMenus(pgAdminMainScreen, configStore, callbacks={}) {
193 // cachedMenus is only populated once the renderer sends its menu definition
194 // via the 'setMenus' IPC. A refresh can be triggered before that happens
195 // (e.g. an auto-update event, or the window being closed while the UI is
196 // still loading). In that case there are no menus to rebuild, so bail out
197 // to avoid dereferencing an undefined menu list.
198 if (!cachedMenus) return;
199 buildAndSetMenus(cachedMenus, pgAdminMainScreen, configStore, callbacks);
200}
201
202export function setupMenu(pgAdminMainScreen, configStore, callbacks={}) {
203 ipcMain.on('setMenus', (event, menus)=>{

Callers 2

updateConfigAndMenusFunction · 0.90

Calls 1

buildAndSetMenusFunction · 0.85

Tested by

no test coverage detected