Skip to content

Commit

Permalink
Fix unti tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIvaniv committed Feb 21, 2024
1 parent d795f57 commit 163acaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/editor-ui/src/components/WorkflowLMChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default defineComponent({
this.messages = this.getChatMessages();
this.setNode();
setTimeout(() => this.$refs.inputField.focus(), 0);
setTimeout(() => this.$refs.inputField?.focus(), 0);
},
methods: {
displayExecution(executionId: string) {
Expand All @@ -245,12 +245,12 @@ export default defineComponent({
) {
const inputField = this.$refs.inputField as HTMLInputElement;
inputField.blur();
inputField?.blur();
this.currentMessage =
pastMessages[pastMessages.length - 1 - this.previousMessageIndex] ?? '';
this.previousMessageIndex = (this.previousMessageIndex + 1) % pastMessages.length;
// Refocus to move the cursor to the end of the input
setTimeout(() => inputField.focus(), 0);
setTimeout(() => inputField?.focus(), 0);
}
if (event.key === 'Enter' && !event.shiftKey && this.currentMessage) {
void this.sendChatMessage(this.currentMessage);
Expand Down

0 comments on commit 163acaf

Please sign in to comment.