Skip to content

Commit

Permalink
Reset input after selecting recommended item
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuepbach committed Jul 13, 2024
1 parent 713e8b2 commit 211820f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/(app)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
const handleSubmit = async (e: SubmitEvent) => {
e.preventDefault();
addItem(newItem);
newItem = '';
};
const addItem = async (name: string) => {
if (name !== '' && ws?.readyState === WebSocket.OPEN) {
ws?.send(JSON.stringify({ operation: 'add', name }));
newItem = '';
}
};
Expand Down

0 comments on commit 211820f

Please sign in to comment.