Skip to content

Commit

Permalink
Set visible back to True for operator inputs upon removal of the output
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Oct 24, 2024
1 parent 049a6ae commit 266da30
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/base/src/panelview/objecttree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { v4 as uuid } from 'uuid';
import visibilitySvg from '../../style/icon/visibility.svg';
import visibilityOffSvg from '../../style/icon/visibilityOff.svg';
import { IControlPanelModel } from '../types';
import { setVisible } from '../commands';

const visibilityIcon = new LabIcon({
name: 'jupytercad:visibilityIcon',
Expand Down Expand Up @@ -98,7 +99,7 @@ interface IProps {

export const handleRemoveObject = (
objectId: string,
sharedModel: any,
sharedModel: IJupyterCadDoc,
syncSelected: () => void
): void => {
if (!sharedModel) {
Expand Down Expand Up @@ -130,7 +131,13 @@ export const handleRemoveObject = (
}).then(({ button: { accept } }) => {
if (accept) {
const toRemove = dependants.concat([objectId]);
sharedModel.removeObjects(toRemove);
const objetToRemove = sharedModel.getObjectByName(objectId);
sharedModel.transact(() => {
objetToRemove?.dependencies?.forEach((dependency: string) => {
setVisible(sharedModel, dependency, true);
});
sharedModel.removeObjects(toRemove);
})
}
});

Expand Down

0 comments on commit 266da30

Please sign in to comment.