Skip to content

Conversation

@dchyslenok
Copy link

fix(widget-state): guard setWidgetState when window.openai is undefined

  • Only call window.openai.setWidgetState when it exists
  • Use optional chaining in the effect dependency to prevent errors
  • Avoids runtime crashes in local development where window.openai may be absent

Call setWidgetState only when it exists and use optional chaining in the effect dependency to avoid runtime errors in local dev.
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.

1 participant