🐛 Attempt to fix load crash on UC Browser

This commit is contained in:
Baptiste Arnaud
2023-02-25 19:15:43 +01:00
parent c889f302f6
commit 5dd87554c3
11 changed files with 33 additions and 25 deletions

View File

@@ -67,7 +67,7 @@ export const ConversationContainer = (props: Props) => {
})
const sendMessage = async (message: string | undefined) => {
const currentBlockId = chatChunks().at(-1)?.input?.id
const currentBlockId = [...chatChunks()].pop()?.input?.id
if (currentBlockId && props.onAnswer && message)
props.onAnswer({ message, blockId: currentBlockId })
const longRequest = setTimeout(() => {
@@ -116,7 +116,7 @@ export const ConversationContainer = (props: Props) => {
}
const handleAllBubblesDisplayed = async () => {
const lastChunk = chatChunks().at(-1)
const lastChunk = [...chatChunks()].pop()
if (!lastChunk) return
if (isNotDefined(lastChunk.input)) {
props.onEnd?.()
@@ -124,7 +124,7 @@ export const ConversationContainer = (props: Props) => {
}
const handleNewBubbleDisplayed = async (blockId: string) => {
const lastChunk = chatChunks().at(-1)
const lastChunk = [...chatChunks()].pop()
if (!lastChunk) return
if (lastChunk.clientSideActions) {
const actionsToExecute = lastChunk.clientSideActions.filter(

View File

@@ -1,6 +1,5 @@
import { z } from 'zod'
import { ComparisonOperators, LogicalOperator } from '../../logic/condition'
import { createId } from '@paralleldrive/cuid2'
import { IntegrationBlockType } from '../enums'
import { GoogleSheetsAction } from './enums'
import { blockBaseSchema } from '../../baseSchemas'
@@ -72,7 +71,9 @@ export const googleSheetsBlockSchema = blockBaseSchema.and(
export const defaultGoogleSheetsOptions: GoogleSheetsOptions = {}
export const defaultGoogleSheetsGetOptions: GoogleSheetsGetOptions = {
export const defaultGoogleSheetsGetOptions = (
createId: () => string
): GoogleSheetsGetOptions => ({
action: GoogleSheetsAction.GET,
cellsToExtract: [
{
@@ -87,25 +88,29 @@ export const defaultGoogleSheetsGetOptions: GoogleSheetsGetOptions = {
],
logicalOperator: LogicalOperator.AND,
},
}
})
export const defaultGoogleSheetsInsertOptions: GoogleSheetsInsertRowOptions = {
export const defaultGoogleSheetsInsertOptions = (
createId: () => string
): GoogleSheetsInsertRowOptions => ({
action: GoogleSheetsAction.INSERT_ROW,
cellsToInsert: [
{
id: createId(),
},
],
}
})
export const defaultGoogleSheetsUpdateOptions: GoogleSheetsUpdateRowOptions = {
export const defaultGoogleSheetsUpdateOptions = (
createId: () => string
): GoogleSheetsUpdateRowOptions => ({
action: GoogleSheetsAction.UPDATE_ROW,
cellsToUpsert: [
{
id: createId(),
},
],
}
})
export type GoogleSheetsBlock = z.infer<typeof googleSheetsBlockSchema>
export type GoogleSheetsOptions = z.infer<typeof googleSheetsOptionsSchema>

View File

@@ -9,7 +9,6 @@
"zod": "3.20.6"
},
"devDependencies": {
"@paralleldrive/cuid2": "2.2.0",
"db": "workspace:*",
"next": "13.1.6",
"tsconfig": "workspace:*",

View File

@@ -1,6 +1,6 @@
{
"name": "wordpress",
"version": "3.1.0",
"version": "3.1.1",
"main": "index.js",
"repository": "https://github.com/baptisteArno/typebot.io",
"author": "baptisteArno",
@@ -11,7 +11,7 @@
},
"scripts": {
"deploy": "pnpm copy && pnpm commit",
"copy": "svn copy ./trunk ./tags/3.1.0",
"commit": "svn ci -m 'Fix admin critical bug and introduce excluded pages'"
"copy": "svn copy ./trunk ./tags/3.1.1",
"commit": "svn ci -m 'Fix excluded pages when empty'"
}
}

View File

@@ -5,7 +5,7 @@ Requires at least: 5.0
Tested up to: 6.0
License: GPL 2.0
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Stable Tag: 3.1.0
Stable Tag: 3.1.1
Build beautiful conversational forms
@@ -26,6 +26,9 @@ This plugin relies on Typebot which is a tool that allows you to create conversa
3. Activate your Typebot with the "Typebot" admin button located in the sidebar
== Changelog ==
= 3.1.1 =
* Fix excluded pages when empty
= 3.1.0 =
* Breaking change! You will need to import the new code snippet again.
* Fix wp admin crash

View File

@@ -45,6 +45,8 @@ class Typebot_Public
}
$arr_js = substr($arr_js, 0, -1) . '];';
echo $arr_js;
} else {
echo 'const typebotExcludePaths = null;';
}
if (get_option('init_snippet') && get_option('init_snippet') !== '') {

View File

@@ -3,7 +3,7 @@
/**
* Plugin Name: Typebot
* Description: Convert more with conversational forms
* Version: 3.1.0
* Version: 3.1.1
* Author: Typebot
* Author URI: http://typebot.io/
* License: GPL-2.0+
@@ -16,7 +16,7 @@ if (!defined('WPINC')) {
die();
}
define('TYPEBOT_VERSION', '3.1.0');
define('TYPEBOT_VERSION', '3.1.1');
function activate_typebot()
{