mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-27 06:50:48 -08:00
refactor: cleanup initIPCHandlers
This commit is contained in:
parent
5a94266d3a
commit
762e1bb596
7 changed files with 32 additions and 78 deletions
|
|
@ -27,28 +27,9 @@ export class WorkspaceView implements IWorkspaceViewService {
|
|||
@inject(serviceIdentifier.Preference) private readonly preferenceService: IPreferenceService,
|
||||
@inject(serviceIdentifier.MenuService) private readonly menuService: IMenuService,
|
||||
) {
|
||||
this.initIPCHandlers();
|
||||
this.registerMenu();
|
||||
}
|
||||
|
||||
private initIPCHandlers(): void {
|
||||
ipcMain.handle('request-set-active-workspace', async (_event, id) => {
|
||||
if (this.workspaceService.get(id) !== undefined) {
|
||||
await this.setActiveWorkspaceView(id);
|
||||
this.menuService.buildMenu();
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('request-set-workspace', async (_event, id, options) => {
|
||||
await this.setWorkspaceView(id, options);
|
||||
this.menuService.buildMenu();
|
||||
});
|
||||
ipcMain.handle('request-set-workspaces', async (_event, workspaces) => {
|
||||
await this.setWorkspaceViews(workspaces);
|
||||
this.menuService.buildMenu();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare workspaces on startup
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue