Skip to content

Commit 861a8c7

Browse files
Remove RTC drive prefix from filepath added by jupyter-collaboration when using notebook scheduler widget
1 parent e6aa27a commit 861a8c7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ function activatePlugin(
303303
commands.addCommand(CommandIDs.createJobCurrentNotebook, {
304304
execute: async () => {
305305
eventLogger('notebook-header.create-job');
306-
// Get the current notebook's name and path
307-
const contentsModel =
308-
notebookTracker.currentWidget?.context?.contentsModel;
309-
const filePath = contentsModel?.path ?? '';
310-
const fileName = contentsModel?.name ?? '';
306+
// Get the current notebook's path and name
307+
const widget = fileBrowserTracker.currentWidget;
308+
const filePath =
309+
getSelectedFilePath(widget, app.serviceManager.contents) ?? '';
310+
const fileName = getSelectedFileBaseName(widget) ?? '';
311311

312312
// Update the job form inside the notebook jobs widget
313313
const newCreateModel = emptyCreateJobModel();
-466 Bytes
Loading

0 commit comments

Comments
 (0)