Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip
Browse files Browse the repository at this point in the history
jnumainville committed May 7, 2024
1 parent 4f82389 commit ce0f332
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ export function {{ cookiecutter.__js_plugin_view_obj }}(props: WidgetComponentPr
useEffect(() => {
async function init() {
// Fetch the widget from the server
const fetched_widget = await fetch();
const fetched_widget = await fetch() as Widget;
setWidget(fetched_widget);


@@ -62,7 +62,9 @@ export function {{ cookiecutter.__js_plugin_view_obj }}(props: WidgetComponentPr
<button
onClick={() => {
// Send the message to the server via the widget
widget.sendMessage(formText, []);
if (widget) {
widget.sendMessage(formText, []);
}
}}>
Send
</button>

0 comments on commit ce0f332

Please sign in to comment.