Skip to content

Commit

Permalink
fix(message): do not showing command
Browse files Browse the repository at this point in the history
  • Loading branch information
PleahMaCaka committed Oct 31, 2023
1 parent fb222c2 commit eaf9860
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib/components/chat/messages/AssistantMessage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@
import { afterUpdate } from "svelte"
import { get } from "svelte/store"
// extract contents within backticks
const regex = /`([^`]*)`/g
export let message: string = ""
let showingMessage = ""
let delay = 0
message.split("").forEach(char => {
message.replaceAll(regex, "").trim().split("").forEach(char => {
delay += get(stateStore).delay
setTimeout(() => {
showingMessage += char
}, delay)
})
// extract contents within backticks
const regex = /`([^`]*)`/g
let raw_commands: Array<string> = [] // raw commands but extract only the first one
let command: string // the first element of commands if it exists
Expand Down

0 comments on commit eaf9860

Please sign in to comment.