Skip to content

Commit c8139f9

Browse files
committed
formatting fixes
1 parent 59b8d28 commit c8139f9

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

emain/emain-window.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { delay, ensureBoundsAreVisible, waveKeyToElectronKey } from "./emain-uti
1818
import { log } from "./log";
1919
import { getElectronAppBasePath, unamePlatform } from "./platform";
2020
import { updater } from "./updater";
21-
21+
2222
export type WindowOpts = {
2323
unamePlatform: string;
2424
};
@@ -302,14 +302,10 @@ export class WaveBrowserWindow extends BaseWindow {
302302

303303
// If the workspace is already owned by a window, then we can just call SwitchWorkspace without first prompting the user, since it'll just focus to the other window.
304304
const workspaceList = await WorkspaceService.ListWorkspaces();
305-
if (!workspaceList?.find((wse) => wse.workspaceid === workspaceId)?.windowid) {
306-
const curWorkspace = await WorkspaceService.GetWorkspace(this.workspaceId);
307-
if (curWorkspace == undefined) { // @jalileh this occurs when we have already deleted the current workspace
308-
await this._queueActionInternal({ op: "switchworkspace", workspaceId });
309-
return;
310-
}
311-
312-
if (isNonEmptyUnsavedWorkspace(curWorkspace)) {
305+
if (!workspaceList?.find((wse) => wse.workspaceid === workspaceId)?.windowid) {
306+
const curWorkspace = await WorkspaceService.GetWorkspace(this.workspaceId);
307+
308+
if (curWorkspace && isNonEmptyUnsavedWorkspace(curWorkspace)) {
313309
console.log(
314310
`existing unsaved workspace ${this.workspaceId} has content, opening workspace ${workspaceId} in new window`
315311
);
@@ -423,7 +419,7 @@ export class WaveBrowserWindow extends BaseWindow {
423419
tabView?.positionTabOffScreen(curBounds);
424420
}
425421
}
426-
422+
427423
async queueCreateTab(pinned = false) {
428424
await this._queueActionInternal({ op: "createtab", pinned });
429425
}
@@ -705,15 +701,15 @@ ipcMain.on("delete-workspace", (event, workspaceId) => {
705701
console.log("user cancelled workspace delete", workspaceId, ww?.waveWindowId);
706702
return;
707703
}
708-
709-
const newWorkspaceId = await WorkspaceService.DeleteWorkspace(workspaceId)
704+
705+
const newWorkspaceId = await WorkspaceService.DeleteWorkspace(workspaceId);
710706
console.log("delete-workspace done", workspaceId, ww?.waveWindowId);
711-
if (ww?.workspaceId == workspaceId){
712-
if ( newWorkspaceId ) {
713-
await ww.switchWorkspace(newWorkspaceId)
707+
if (ww?.workspaceId == workspaceId) {
708+
if (newWorkspaceId) {
709+
await ww.switchWorkspace(newWorkspaceId);
714710
} else {
715-
console.log("delete-workspace closing window", workspaceId, ww?.waveWindowId);
716-
ww.destroy();
711+
console.log("delete-workspace closing window", workspaceId, ww?.waveWindowId);
712+
ww.destroy();
717713
}
718714
}
719715
});

0 commit comments

Comments
 (0)