From f4a4d8a2094d9485d629e568d91d4f253a76bce8 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Sun, 5 Jan 2025 20:25:48 +0700 Subject: [PATCH] feat: unlimited credits for the open-source --- .../launches/polonto/polonto.picture.generation.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx b/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx index 61ec8ef8c..f1e4bfd74 100644 --- a/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx +++ b/apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx @@ -11,15 +11,20 @@ import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; import useSWR from 'swr'; import { Button } from '@gitroom/react/form/button'; import { useToaster } from '@gitroom/react/toaster/toaster'; +import { useVariables } from '@gitroom/react/helpers/variable.context'; const GenerateTab = observer(({ store }: any) => { const inputRef = React.useRef(null); const [image, setImage] = React.useState(null); const [loading, setLoading] = React.useState(false); + const {billingEnabled} = useVariables(); const fetch = useFetch(); const toast = useToaster(); const loadCredits = useCallback(async () => { + if (!billingEnabled) { + return {credits: 1000}; + } return ( await fetch(`/copilot/credits`, { method: 'GET',