Remove WindowManager, separate functionality into smaller modules (#2682)
* Move sendToRenderer to respective singletons * Move to using ViewManager call for getting view by webContentsId * Move show and create logic to main window, handle deep linking seperately * Move resizing logic and event handing to mainWindow * Move server switching logic to main/app * Move tab switching logic to main/app, rely on showById for most usage * Migrate remaining functions, remove windowManager objects, set up imports for self-contained singletons * Fix E2E tests * Update src/main/app/servers.ts Co-authored-by: Elias Nahum <nahumhbl@gmail.com> --------- Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
@@ -5,10 +5,11 @@
|
||||
|
||||
import {Menu, MenuItem, MenuItemConstructorOptions} from 'electron';
|
||||
|
||||
import WindowManager from 'main/windows/windowManager';
|
||||
import {localizeMessage} from 'main/i18nManager';
|
||||
import ServerManager from 'common/servers/serverManager';
|
||||
|
||||
import {localizeMessage} from 'main/i18nManager';
|
||||
import SettingsWindow from 'main/windows/settingsWindow';
|
||||
import {switchServer} from 'main/app/servers';
|
||||
|
||||
export function createTemplate() {
|
||||
const teams = ServerManager.getOrderedServers();
|
||||
@@ -17,7 +18,7 @@ export function createTemplate() {
|
||||
return {
|
||||
label: team.name.length > 50 ? `${team.name.slice(0, 50)}...` : team.name,
|
||||
click: () => {
|
||||
WindowManager.switchServer(team.id);
|
||||
switchServer(team.id);
|
||||
},
|
||||
};
|
||||
}), {
|
||||
|
Reference in New Issue
Block a user