(event, configStore, pgAdminMainScreen, menuCallbacks)
| 14 | // This function stores the flags in configStore that are needed |
| 15 | // for auto-update and refreshes menus |
| 16 | export 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 |
| 31 | function registerAutoUpdaterEvents({ pgAdminMainScreen, configStore, menuCallbacks }) { |
no test coverage detected