Skip to content

Commit

Permalink
🐛 Attempt to fix load crash on UC Browser
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 25, 2023
1 parent c889f30 commit 5dd8755
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 })
}
Expand Down
2 changes: 1 addition & 1 deletion apps/viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"path": "node_modules/cz-emoji"
}
},
"packageManager": "pnpm@7.27.1"
"packageManager": "pnpm@7.28.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -116,15 +116,15 @@ 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?.()
}
}

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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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: [
{
Expand All @@ -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>
Expand Down
1 change: 0 additions & 1 deletion packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"zod": "3.20.6"
},
"devDependencies": {
"@paralleldrive/cuid2": "2.2.0",
"db": "workspace:*",
"next": "13.1.6",
"tsconfig": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/wordpress/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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'"
}
}
5 changes: 4 additions & 1 deletion packages/wordpress/trunk/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/wordpress/trunk/public/class-typebot-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ function typebot_script()
}
$arr_js = substr($arr_js, 0, -1) . '];';
echo $arr_js;
} else {
echo 'const typebotExcludePaths = null;';
}
if (get_option('init_snippet') && get_option('init_snippet') !== '') {

Expand Down
4 changes: 2 additions & 2 deletions packages/wordpress/trunk/typebot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand All @@ -16,7 +16,7 @@
die();
}

define('TYPEBOT_VERSION', '3.1.0');
define('TYPEBOT_VERSION', '3.1.1');

function activate_typebot()
{
Expand Down
4 changes: 1 addition & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 comments on commit 5dd8755

@vercel
Copy link

@vercel vercel bot commented on 5dd8755 Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
docs.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 5dd8755 Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5dd8755 Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

stan.vselise.com
start.taxtree.io
typebot.aloe.bot
voicehelp.cr8.ai
zap.fundviser.in
app.chatforms.net
bot.hostnation.de
bot.maitempah.com
bot.phuonghub.com
bot.rihabilita.it
carsalesenquiry.com
chat.marius.digital
chatbot.matthesv.de
chatbot.repplai.com
demo.botscientis.us
demo.wemakebots.xyz
forms.webisharp.com
kbsub.wpwakanda.com
live.botscientis.us
mentoria.omelhor.vc
nutrisamirbayde.com
order.maitempah.com
quest.wpwakanda.com
support.wawplus.com
survey1.digienge.io
surveys.essiell.com
test.botscientis.us
test.reventepro.com
typebot.stillio.com
wordsandimagery.com
88584434.therpm.club
92109660.therpm.club
abbonamento.bwell.it
bium.gratirabbit.com
bot.ansuraniphone.my
bot.barrettamario.it
bot.cotemeuplano.com
bot.leadbooster.help
bot.mycompay.reviews
chat.hayurihijab.com
chatbee.agfunnel.com
click.sevenoways.com
connect.growthguy.in
forms.bonanza.design
hello.advergreen.com
kuiz.sistemniaga.com
offer.botscientis.us
sellmycarglasgow.com
talkbot.agfunnel.com
tenorioadvogados.com
uppity.wpwakanda.com
abutton.wpwakanda.com
acelera.maxbot.com.br
aidigitalmarketing.kr
bbutton.wpwakanda.com
bot.coachayongzul.com
bot.digitalpointer.id
mainmenu1one.wpwakanda.com
tarian.theiofoundation.org
ted.meujalecobrasil.com.br
type.dericsoncalari.com.br
bot.pinpointinteractive.com
bot.polychromes-project.com
bot.seidinembroseanchetu.it
chatbot.berbelanjabiz.trade
designguide.techyscouts.com
jcapp.virtuesocialmedia.com
liveconvert2.kandalearn.com
presente.empresarias.com.mx
sell.sellthemotorhome.co.uk
anamnese.odontopavani.com.br
austin.channelautomation.com
bot.marketingplusmindset.com
bot.seidibergamoseanchetu.it
desabafe.sergiolimajr.com.br
download.venturemarketing.in
jc-app.virtuesocialmedia.com
piazzatorre.barrettamario.it
type.cookieacademyonline.com
bot.brigadeirosemdrama.com.br
forms.escoladeautomacao.com.br
onboarding.libertydreamcare.ie
type.talitasouzamarques.com.br
agendamento.sergiolimajr.com.br
anamnese.clinicamegasjdr.com.br
bookings.littlepartymonkeys.com
bot.comercializadoraomicron.com
elevateyourmind.groovepages.com
viewer-v2-typebot-io.vercel.app
yourfeedback.comebackreward.com
gerador.verificadordehospedes.com
personal-trainer.barrettamario.it
preagendamento.sergiolimajr.com.br
studiotecnicoimmobiliaremerelli.it
download.thailandmicespecialist.com
register.thailandmicespecialist.com
bot.studiotecnicoimmobiliaremerelli.it
pesquisa.escolamodacomproposito.com.br
anamnese.clinicaramosodontologia.com.br
viewer-v2-git-main-typebot-io.vercel.app

Please sign in to comment.