🚸 (variables) Allow null values in variable list

This commit is contained in:
Baptiste Arnaud
2023-03-21 15:42:03 +01:00
parent c52a284013
commit 0c39ae41b6
18 changed files with 69 additions and 33 deletions

View File

@@ -13,7 +13,7 @@ import { Plan, Workspace } from '@typebot.io/prisma'
import React from 'react'
import { parseNumberWithCommas } from '@typebot.io/lib'
import { getChatsLimit, getStorageLimit } from '@typebot.io/lib/pricing'
import { trpc } from '@/lib/trpc'
import { defaultQueryOptions, trpc } from '@/lib/trpc'
import { storageToReadable } from '../helpers/storageToReadable'
type Props = {
@@ -21,9 +21,12 @@ type Props = {
}
export const UsageProgressBars = ({ workspace }: Props) => {
const { data, isLoading } = trpc.billing.getUsage.useQuery({
workspaceId: workspace.id,
})
const { data, isLoading } = trpc.billing.getUsage.useQuery(
{
workspaceId: workspace.id,
},
defaultQueryOptions
)
const totalChatsUsed = data?.totalChatsUsed ?? 0
const totalStorageUsed = data?.totalStorageUsed ?? 0