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

Function updateConfigAndMenus

runtime/src/js/autoUpdaterHandler.js:16–28  ·  view source on GitHub ↗
(event, configStore, pgAdminMainScreen, menuCallbacks)

Source from the content-addressed store, hash-verified

14// This function stores the flags in configStore that are needed
15// for auto-update and refreshes menus
16export function updateConfigAndMenus(event, configStore, pgAdminMainScreen, menuCallbacks) {
17 const flags = {
18 'update-available': { update_downloading: true },
19 'update-not-available': { update_downloading: false },
20 'update-downloaded': { update_downloading: false, update_downloaded: true },
21 'error-close': { update_downloading: false, update_downloaded: false },
22 };
23 const flag = flags[event];
24 if (flag) {
25 Object.entries(flag).forEach(([k, v]) => configStore.set(k, v));
26 refreshMenus(pgAdminMainScreen, configStore, menuCallbacks);
27 }
28}
29
30// This function registers autoUpdater event listeners ONCE
31function registerAutoUpdaterEvents({ pgAdminMainScreen, configStore, menuCallbacks }) {

Callers 2

launchPgAdminWindowFunction · 0.90

Calls 2

refreshMenusFunction · 0.90
setMethod · 0.45

Tested by

no test coverage detected