Skip to content

Conversation

@ryanrhughes
Copy link

What does this PR do?

Fixes a regression caused by #7702 that causes a crash when using the --prompt flag.

Fixes #7818
Fixes #7850

How did you verify your code works?

I ran tests with --prompt populated and without, as well as tested that you can still successfully fork from the first message so as to not cause any regression from the original PR.

Fixes anomalyco#7818

The parent's onMount runs before the child Prompt component's onMount,
so the prompt ref is undefined when prompt.set() is called. Using
queueMicrotask() defers execution until after the child's onMount
completes and the ref is available.
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@markjaquith
Copy link
Contributor

Regression was fixed in 3a30773

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opentui: fatal: undefined is not an object (evaluating 'prompt.set') opentui: fatal: undefined is not an object (evaluating 'prompt.set')

2 participants