2
0

🐛 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

@ -26,6 +26,7 @@ import { CredentialsDropdown } from '@/features/credentials'
import { useSheets } from '../../hooks/useSheets'
import { Sheet } from '../../types'
import { RowsFilterTableList } from './RowsFilterTableList'
import { createId } from '@paralleldrive/cuid2'
type Props = {
options: GoogleSheetsOptions
@ -65,21 +66,21 @@ export const GoogleSheetsSettingsBody = ({
case GoogleSheetsAction.GET: {
const newOptions: GoogleSheetsGetOptions = {
...baseOptions,
...defaultGoogleSheetsGetOptions,
...defaultGoogleSheetsGetOptions(createId),
}
return onOptionsChange({ ...newOptions })
}
case GoogleSheetsAction.INSERT_ROW: {
const newOptions: GoogleSheetsInsertRowOptions = {
...baseOptions,
...defaultGoogleSheetsInsertOptions,
...defaultGoogleSheetsInsertOptions(createId),
}
return onOptionsChange({ ...newOptions })
}
case GoogleSheetsAction.UPDATE_ROW: {
const newOptions: GoogleSheetsUpdateRowOptions = {
...baseOptions,
...defaultGoogleSheetsUpdateOptions,
...defaultGoogleSheetsUpdateOptions(createId),
}
return onOptionsChange({ ...newOptions })
}

View File

@ -20,7 +20,6 @@
"aws-sdk": "2.1321.0",
"bot-engine": "workspace:*",
"cors": "2.8.5",
"@paralleldrive/cuid2": "2.2.0",
"db": "workspace:*",
"google-spreadsheet": "3.3.0",
"got": "12.5.3",
@ -35,6 +34,7 @@
"trpc-openapi": "1.1.2"
},
"devDependencies": {
"@paralleldrive/cuid2": "2.2.0",
"@babel/preset-env": "7.20.2",
"@faire/mjml-react": "3.1.1",
"@playwright/test": "1.31.1",

View File

@ -33,5 +33,5 @@
"path": "node_modules/cz-emoji"
}
},
"packageManager": "pnpm@7.27.1"
"packageManager": "pnpm@7.28.0"
}

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()
{

4
pnpm-lock.yaml generated
View File

@ -389,7 +389,6 @@ importers:
utils: workspace:*
zod: 3.20.6
dependencies:
'@paralleldrive/cuid2': 2.2.0
'@sentry/nextjs': 7.38.0_next@13.1.6+react@18.2.0
'@trpc/server': 10.12.0
'@typebot.io/js': link:../../packages/js
@ -412,6 +411,7 @@ importers:
devDependencies:
'@babel/preset-env': 7.20.2_@babel+core@7.21.0
'@faire/mjml-react': 3.1.1_7tbcn2mecc3yvuxakflodiks3m
'@paralleldrive/cuid2': 2.2.0
'@playwright/test': 1.31.1
'@types/cors': 2.8.13
'@types/google-spreadsheet': 3.3.1
@ -622,7 +622,6 @@ importers:
packages/models:
specifiers:
'@paralleldrive/cuid2': 2.2.0
db: workspace:*
next: 13.1.6
tsconfig: workspace:*
@ -631,7 +630,6 @@ importers:
dependencies:
zod: 3.20.6
devDependencies:
'@paralleldrive/cuid2': 2.2.0
db: link:../db
next: 13.1.6_biqbaboplfbrettd7655fr4n2y
tsconfig: link:../tsconfig