Skip to content

Commit 6ed6905

Browse files
committed
fix #7684 -- Jupyter, VS Code, Pluto, RStudio button on +New page goes to wrong "tab"
1 parent 59ce54f commit 6ed6905

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

src/packages/frontend/project/new/file-type-selector.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,7 @@ export function FileTypeSelector({
224224
name={"Compute Server: GPUs and VM's"}
225225
icon="servers"
226226
on_click={() => {
227-
projectActions?.setState({ create_compute_server: true });
228-
projectActions?.set_active_tab("servers", {
229-
change_history: true,
230-
});
227+
projectActions?.setServerTab("compute-servers");
231228
}}
232229
size={btnSize}
233230
/>
@@ -239,12 +236,10 @@ export function FileTypeSelector({
239236
<Col sm={doubleSm} md={doubleMd}>
240237
<NewFileButton
241238
size={btnSize}
242-
name={`Jupyter, VS Code, Pluto, RStudio, etc....`}
239+
name={`JupyterLab, VS Code, Pluto, RStudio, etc....`}
243240
ext="server"
244241
on_click={() => {
245-
projectActions.set_active_tab("servers", {
246-
change_history: true,
247-
});
242+
projectActions?.setServerTab("notebooks");
248243
}}
249244
active={false}
250245
/>

src/packages/frontend/project_actions.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import {
8181
FlyoutLogFilter,
8282
} from "./project/page/flyouts/utils";
8383
import { modalParams } from "@cocalc/frontend/compute/select-server-for-file";
84-
import { setServerTab } from "@cocalc/frontend/compute/tab";
84+
import { setServerTab, TabName } from "@cocalc/frontend/compute/tab";
8585

8686
const { defaults, required } = misc;
8787

@@ -3460,14 +3460,18 @@ export class ProjectActions extends Actions<ProjectStoreState> {
34603460
};
34613461

34623462
showComputeServers = () => {
3463-
setServerTab(this.project_id, "compute-servers");
3464-
this.set_active_tab("servers", {
3465-
change_history: true,
3466-
});
3463+
this.setServerTab("compute-servers");
34673464
};
34683465

34693466
createComputeServerDialog = () => {
34703467
this.setState({ create_compute_server: true });
34713468
this.showComputeServers();
34723469
};
3470+
3471+
setServerTab = (name: TabName) => {
3472+
setServerTab(this.project_id, name);
3473+
this.set_active_tab("servers", {
3474+
change_history: true,
3475+
});
3476+
};
34733477
}

0 commit comments

Comments
 (0)