diff --git a/backend/main.py b/backend/main.py index 4eb09fa..396fefa 100644 --- a/backend/main.py +++ b/backend/main.py @@ -33,7 +33,7 @@ app.add_middleware( # Useful for debugging purposes when you don't want to waste GPT4-Vision credits # Setting to True will stream a mock response instead of calling the OpenAI API -SHOULD_MOCK_AI_RESPONSE = False +SHOULD_MOCK_AI_RESPONSE = True app.include_router(screenshot.router) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index c2ec3fe..1df8b05 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -40,6 +40,7 @@ function App() { screenshotOneApiKey: null, isImageGenerationEnabled: true, editorTheme: "cobalt", + termOfServiceAccepted: false, }, "setting" ); @@ -111,10 +112,17 @@ function App() { setUpdateInstruction(""); } + const onTermDialogOpenChange = (open: boolean) => { + setSettings((s) => ({ + ...s, + termOfServiceAccepted: !open, + })); + }; + return (
{IS_RUNNING_ON_CLOUD && } - {IS_RUNNING_ON_CLOUD && } + {IS_RUNNING_ON_CLOUD && }
diff --git a/frontend/src/components/TermsOfServiceDialog.tsx b/frontend/src/components/TermsOfServiceDialog.tsx index de079b0..2bd3178 100644 --- a/frontend/src/components/TermsOfServiceDialog.tsx +++ b/frontend/src/components/TermsOfServiceDialog.tsx @@ -6,15 +6,14 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog"; -import { useState } from "react"; -const termAcceptedCacheKey = 'term_of_service_accepted'; - -function TermsOfServiceDialog() { - const [isOpen, setIsOpen] = useState(() => !localStorage.getItem(termAcceptedCacheKey)); +const TermsOfServiceDialog: React.FC<{ + open: boolean; + onOpenChange: (open: boolean) => void; +}> = ({ open, onOpenChange }) => { return ( - + Terms of Service @@ -42,13 +41,11 @@ function TermsOfServiceDialog() {
- { - localStorage.setItem(termAcceptedCacheKey, 'true'); - }}>Agree + Agree ); -} +}; export default TermsOfServiceDialog; diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 6f44e9f..6ffabec 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -3,4 +3,5 @@ export interface Settings { screenshotOneApiKey: string | null; isImageGenerationEnabled: boolean; editorTheme: string; + termOfServiceAccepted: boolean; }