diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1e76d55..ea095c0 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -21,6 +21,7 @@ import { Settings } from "./types"; import { IS_RUNNING_ON_CLOUD } from "./config"; import { PicoBadge } from "./components/PicoBadge"; import { OnboardingNote } from "./components/OnboardingNote"; +import { usePersistedState } from "./hooks/usePersistedState"; import { UrlInputSection } from "./components/UrlInputSection"; function App() { @@ -32,12 +33,15 @@ function App() { const [executionConsole, setExecutionConsole] = useState([]); const [updateInstruction, setUpdateInstruction] = useState(""); const [history, setHistory] = useState([]); - const [settings, setSettings] = useState({ - openAiApiKey: null, - screenshotOneApiKey: null, - isImageGenerationEnabled: true, - editorTheme: "cobalt", - }); + const [settings, setSettings] = usePersistedState( + { + openAiApiKey: null, + screenshotOneApiKey: null, + isImageGenerationEnabled: true, + editorTheme: "cobalt", + }, + "setting" + ); const downloadCode = () => { // Create a blob from the generated code diff --git a/frontend/src/components/OnboardingNote.tsx b/frontend/src/components/OnboardingNote.tsx index 437bc1e..8cc6f11 100644 --- a/frontend/src/components/OnboardingNote.tsx +++ b/frontend/src/components/OnboardingNote.tsx @@ -10,7 +10,8 @@ export function OnboardingNote() { credit on the Billing dashboard.
- This key is never stored. This app is open source. You can{" "} + This key is only stored in your browser. Never stored on servers. This + app is open source. You can{" "} check the code to confirm. diff --git a/frontend/src/components/SettingsDialog.tsx b/frontend/src/components/SettingsDialog.tsx index 9b46b90..f7004d3 100644 --- a/frontend/src/components/SettingsDialog.tsx +++ b/frontend/src/components/SettingsDialog.tsx @@ -58,8 +58,9 @@ function SettingsDialog({ settings, setSettings }: Props) {