⚡ (audio) Add autoplay switch in settings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
||||
@@ -74,7 +74,10 @@ export const Bot = (props: BotProps & { class?: string }) => {
|
||||
return setError(new Error("The bot you're looking for doesn't exist."))
|
||||
}
|
||||
|
||||
if (!data) return setError(new Error("Error! Couldn't initiate the chat."))
|
||||
if (!data) {
|
||||
if (error) console.error(error)
|
||||
return setError(new Error("Error! Couldn't initiate the chat."))
|
||||
}
|
||||
|
||||
if (data.resultId && typebotIdFromProps)
|
||||
setResultInStorage(data.typebot.settings.general.rememberUser?.storage)(
|
||||
|
||||
@@ -55,7 +55,7 @@ export const HostBubble = (props: Props) => {
|
||||
</Match>
|
||||
<Match when={props.message.type === BubbleBlockType.AUDIO}>
|
||||
<AudioBubble
|
||||
url={(props.message.content as AudioBubbleContent).url}
|
||||
content={props.message.content as AudioBubbleContent}
|
||||
onTransitionEnd={onTransitionEnd}
|
||||
/>
|
||||
</Match>
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { AudioBubbleContent } from '@typebot.io/schemas'
|
||||
import { createSignal, onCleanup, onMount } from 'solid-js'
|
||||
|
||||
type Props = {
|
||||
url: AudioBubbleContent['url']
|
||||
content: AudioBubbleContent
|
||||
onTransitionEnd: (offsetTop?: number) => void
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ export const AudioBubble = (props: Props) => {
|
||||
</div>
|
||||
<audio
|
||||
ref={audioElement}
|
||||
src={props.url}
|
||||
autoplay
|
||||
src={props.content.url}
|
||||
autoplay={props.content.isAutoplayEnabled ?? true}
|
||||
class={
|
||||
'z-10 text-fade-in ' +
|
||||
(isTyping() ? 'opacity-0' : 'opacity-100 m-2')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/nextjs",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"description": "Convenient library to display typebots on your Next.js website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"description": "Convenient library to display typebots on your Next.js website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user