Skip to content

Commit

Permalink
fix: timer
Browse files Browse the repository at this point in the history
  • Loading branch information
KieSun committed Mar 23, 2023
1 parent 8adc6c1 commit 0519cd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Generator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import ErrorMessageItem from './ErrorMessageItem'
import SwitchPrompt from './SwitchPrompt'
import type { ChatMessage, ErrorMessage } from '@/types'

let timer

export default () => {
let inputRef: HTMLTextAreaElement
let messageRef: HTMLDivElement
Expand Down Expand Up @@ -184,7 +186,6 @@ export default () => {
}

createEffect(() => {
let timer
if (loading()) {
timer = setInterval(() => {
messageRef.scrollTo(0, messageRef.scrollHeight)
Expand Down

0 comments on commit 0519cd8

Please sign in to comment.