(e: EditorState)
| 480 | const openScript = useCallback( |
| 481 | async (uuid?: string, template?: string, target?: string) => { |
| 482 | const insertEditor = (e: EditorState) => { |
| 483 | let insertIdx = editorFindIndex(selectedScript); |
| 484 | insertIdx = insertIdx >= 0 ? insertIdx + 1 : editorsRef.current.length; |
| 485 | setEditors((prev) => { |
| 486 | const ret = prev.map((e) => ({ ...e, active: false })); |
| 487 | ret.splice(insertIdx, 0, e); |
| 488 | return ret; |
| 489 | }); |
| 490 | }; |
| 491 | |
| 492 | if (uuid) { |
| 493 | // 如果已在编辑器中,直接激活 |
no test coverage detected