Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions packages/browser-repl/src/components/shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,18 @@ export class Shell extends Component<ShellProps, ShellState> {
};

componentDidMount(): void {
// Store the intial prop value on mount so that we're not using potentially
// updated one when actually running the lines
let evalLines: string[] = [];
if (this.props.initialEvaluate) {
evalLines = Array.isArray(this.props.initialEvaluate)
? this.props.initialEvaluate
: [this.props.initialEvaluate];
}
this.scrollToBottom();
void this.updateShellPrompt().then(async () => {
if (this.props.initialEvaluate) {
const evalLines = Array.isArray(this.props.initialEvaluate)
? this.props.initialEvaluate
: [this.props.initialEvaluate];
for (const input of evalLines) {
await this.onInput(input);
}
for (const input of evalLines) {
await this.onInput(input);
}
});
}
Expand Down