@interopio/workspaces-api 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2781,10 +2781,9 @@
2781
2781
  }
2782
2782
  async close() {
2783
2783
  const controller = getData$3(this).controller;
2784
- const workspaces = await getData$3(this).frame.workspaces();
2784
+ const isLastWorkspaceInFrame = await controller.isLastWorkspaceInFrame(this.id, this.frameId);
2785
2785
  const platformFrameId = (await controller.getPlatformFrameId()).id;
2786
- const shouldCloseFrame = workspaces.length === 1 &&
2787
- workspaces.every((wsp) => wsp.id === this.id) &&
2786
+ const shouldCloseFrame = isLastWorkspaceInFrame &&
2788
2787
  platformFrameId !== this.frame.id;
2789
2788
  if (shouldCloseFrame) {
2790
2789
  return this.frame.close();
@@ -4603,6 +4602,11 @@
4603
4602
  }));
4604
4603
  return workspacesForFrame;
4605
4604
  }
4605
+ async isLastWorkspaceInFrame(workspaceId, frameId) {
4606
+ const workspaceSummaries = await this.getAllWorkspaceSummaries();
4607
+ const summariesForFrame = workspaceSummaries.filter((s) => s.frameId === frameId);
4608
+ return summariesForFrame.length === 1 && summariesForFrame[0].id === workspaceId;
4609
+ }
4606
4610
  async getAllWorkspaceSummaries() {
4607
4611
  const allSummariesResult = await this.bridge.send(OPERATIONS.getAllWorkspacesSummaries.name, {});
4608
4612
  return this.base.getAllWorkspaceSummaries(allSummariesResult);
@@ -5110,7 +5114,7 @@
5110
5114
  }
5111
5115
  }
5112
5116
 
5113
- var version = "4.0.1";
5117
+ var version = "4.0.2";
5114
5118
 
5115
5119
  const composeAPI = (glue, ioc) => {
5116
5120
  const controller = ioc.controller;