Skip to content

Commit 10b52a7

Browse files
committed
fix: Exclude current name from validation when renaming notebook
Signed-off-by: Tomas Kislan <[email protected]>
1 parent 5baa483 commit 10b52a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/notebooks/deepnote/deepnoteExplorerView.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ export class DeepnoteExplorerView {
109109
return;
110110
}
111111

112-
const existingNames = new Set(projectData.project.notebooks.map((nb: DeepnoteNotebook) => nb.name));
112+
const existingNames = new Set(
113+
projectData.project.notebooks
114+
.map((nb: DeepnoteNotebook) => nb.name)
115+
.filter((name: string) => name !== currentName)
116+
);
113117

114118
const newName = await this.promptForNotebookName(currentName, existingNames);
115119

0 commit comments

Comments
 (0)