Skip to content

Commit

Permalink
fix: 🐛 Smash tiny bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 22, 2022
1 parent 6d455a3 commit 1dc2264
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ export const TypebotHeader = () => {
</HStack>

<HStack right="40px" pos="absolute">
<Button onClick={handlePreviewClick}>Preview</Button>
{router.pathname.includes('/edit') && (
<Button onClick={handlePreviewClick}>Preview</Button>
)}
<PublishButton />
</HStack>
</Flex>
Expand Down
18 changes: 11 additions & 7 deletions apps/builder/pages/api/integrations/email/test-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
pass: password,
},
})
const info = await transporter.sendMail({
from: `"${from.name}" <${from.email}>`,
to,
subject: 'Your SMTP configuration is working 🤩',
text: 'This email has been sent to test out your SMTP config.\n\nIf your read this then it has been successful.🚀',
})
res.status(200).send({ message: 'Email sent!', info })
try {
const info = await transporter.sendMail({
from: `"${from.name}" <${from.email}>`,
to,
subject: 'Your SMTP configuration is working 🤩',
text: 'This email has been sent to test out your SMTP config.\n\nIf your read this then it has been successful.🚀',
})
res.status(200).send({ message: 'Email sent!', info })
} catch (err) {
res.status(500).send(err)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { GoogleSpreadsheet } from 'google-spreadsheet'
import { getAuthenticatedGoogleClient } from 'libs/google-sheets'
import { methodNotAllowed } from 'utils'
import { isDefined, methodNotAllowed } from 'utils'
import { getSession } from 'next-auth/react'
import { User } from 'db'
import { withSentry } from '@sentry/nextjs'
Expand All @@ -23,17 +23,23 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
)
await doc.loadInfo()
return res.send({
sheets: await Promise.all(
Array.from(Array(doc.sheetCount)).map(async (_, idx) => {
const sheet = doc.sheetsByIndex[idx]
await sheet.loadHeaderRow()
return {
id: sheet.sheetId,
name: sheet.title,
columns: sheet.headerValues,
}
})
),
sheets: (
await Promise.all(
Array.from(Array(doc.sheetCount)).map(async (_, idx) => {
const sheet = doc.sheetsByIndex[idx]
try {
await sheet.loadHeaderRow()
} catch (err) {
return
}
return {
id: sheet.sheetId,
name: sheet.title,
columns: sheet.headerValues,
}
})
)
).filter(isDefined),
})
}
return methodNotAllowed(res)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const executeWebhook =
const basicAuthHeaderIdx = webhook.headers.findIndex(
(h) =>
h.key?.toLowerCase() === 'authorization' &&
h.value?.toLowerCase().includes('basic')
h.value?.toLowerCase()?.includes('basic')
)
if (basicAuthHeaderIdx !== -1) {
const [username, password] =
Expand Down

2 comments on commit 1dc2264

@vercel
Copy link

@vercel vercel bot commented on 1dc2264 Feb 22, 2022

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 1dc2264 Feb 22, 2022

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:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

Please sign in to comment.