Skip to content

Commit 125294a

Browse files
authored
Notebook API: Fix remove method (#359)
1 parent f4bd9f0 commit 125294a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/jupytercad_lab/jupytercad_lab/notebook/cad_document.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ def get_object(self, name: str) -> Optional["PythonJcadObject"]:
9999
def remove(self, name: str) -> CadDocument:
100100
index = self._get_yobject_index_by_name(name)
101101
if self._objects_array and index != -1:
102-
with self.ydoc.transaction() as t:
103-
self._objects_array.delete(t, index)
102+
self._objects_array.pop(index)
104103
return self
105104

106105
def add_object(self, new_object: "PythonJcadObject") -> CadDocument:

0 commit comments

Comments
 (0)