(id: string)
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | export function deleteModel(id: string): void { |
| 51 | const key = id; |
| 52 | useEditorStore.getState().setModels((models) => { |
| 53 | const { [key]: _drop, ...rest } = models; |
| 54 | return rest; |
| 55 | }); |
| 56 | const sel = useEditorStore.getState().selection; |
| 57 | if (sel.kind === "model" && sel.id === id) { |
| 58 | useEditorStore.getState().clearSelection(); |
| 59 | } |
| 60 | } |