@k-electron/k-bench 0.5.0 → 0.6.0
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.
|
@@ -102,12 +102,7 @@ export function createApp(service, options) {
|
|
|
102
102
|
});
|
|
103
103
|
return c.json(workspace);
|
|
104
104
|
});
|
|
105
|
-
app.post("/api/workspaces/:id/open", async (c) =>
|
|
106
|
-
const body = await jsonBody(c.req.raw);
|
|
107
|
-
return c.json(await service.openWorkspace(c.req.param("id"), {
|
|
108
|
-
showWorker: body.showWorker === true,
|
|
109
|
-
}));
|
|
110
|
-
});
|
|
105
|
+
app.post("/api/workspaces/:id/open", async (c) => c.json(await service.openWorkspace(c.req.param("id"))));
|
|
111
106
|
// The whole record: the tabs in order, and the one shown (null for the Worker).
|
|
112
107
|
app.put("/api/workspaces/:id/right-pane", async (c) => {
|
|
113
108
|
const { shown, tabs } = await jsonBody(c.req.raw);
|
|
@@ -182,19 +182,13 @@ export class Service {
|
|
|
182
182
|
/**
|
|
183
183
|
* Makes the Workspace the Open Workspace and, unless it is Missing, starts its Stopped
|
|
184
184
|
* Prime and Worker, resuming their conversations. Opening it again changes nothing that
|
|
185
|
-
* is running.
|
|
186
|
-
* Worker again, keeping its tabs.
|
|
185
|
+
* is running.
|
|
187
186
|
*/
|
|
188
|
-
async openWorkspace(id
|
|
187
|
+
async openWorkspace(id) {
|
|
189
188
|
const workspace = this.store.getWorkspace(id);
|
|
190
189
|
if (!workspace)
|
|
191
190
|
throw new ServiceError("not_found", "Unknown Workspace");
|
|
192
|
-
this.store.
|
|
193
|
-
this.store.setOpenWorkspaceId(id);
|
|
194
|
-
if (options.showWorker) {
|
|
195
|
-
this.store.setRightPane(id, { ...this.rightPane(id), shown: null });
|
|
196
|
-
}
|
|
197
|
-
});
|
|
191
|
+
this.store.setOpenWorkspaceId(id);
|
|
198
192
|
if (isDirectory(workspace.folder))
|
|
199
193
|
await this.startRoles(id);
|
|
200
194
|
return { id };
|