(code: string, stack: Stack)
| 717 | } |
| 718 | |
| 719 | function importFromCode(code: string, stack: Stack) { |
| 720 | // Reset any existing state |
| 721 | reset(); |
| 722 | |
| 723 | // Set up this project |
| 724 | setStack(stack); |
| 725 | |
| 726 | // Create a new commit and set it as the head |
| 727 | const commit = createCommit({ |
| 728 | type: "code_create", |
| 729 | parentHash: null, |
| 730 | variants: [{ code, history: [] }], |
| 731 | inputs: null, |
| 732 | }); |
| 733 | addCommit(commit); |
| 734 | setHead(commit.hash); |
| 735 | |
| 736 | // Set the app state |
| 737 | setAppState(AppState.CODE_READY); |
| 738 | } |
| 739 | |
| 740 | const showContentPanel = |
| 741 | appState === AppState.CODING || |
no test coverage detected