the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clear apiKey when provider changes

+10 -4
+10 -4
apps/web/src/pages/settings/provider/Provider.tsx
··· 1 1 import { useRouterState } from "@tanstack/react-router"; 2 2 import { zodResolver } from "@hookform/resolvers/zod"; 3 3 import { useEffect } from "react"; 4 - import { useForm, useWatch } from "react-hook-form"; 4 + import { useForm } from "react-hook-form"; 5 5 import { z } from "zod"; 6 6 import { useQueryClient } from "@tanstack/react-query"; 7 7 import { useSandboxQuery } from "../../../hooks/useSandbox"; ··· 59 59 const { 60 60 register, 61 61 handleSubmit, 62 - control, 62 + watch, 63 63 setValue, 64 64 formState: { errors }, 65 65 } = useForm<FormValues>({ ··· 79 79 } 80 80 }, [preferences, setValue]); 81 81 82 - const provider = useWatch({ control, name: "provider" }) as Provider; 82 + const provider = watch("provider") as Provider; 83 + 84 + const { onChange: onProviderChange, ...providerRegister } = register("provider"); 83 85 84 86 const onSubmit = async (values: FormValues) => { 85 87 const pref: SandboxProvider = { ··· 142 144 Pick your Sandbox Provider 143 145 </label> 144 146 <select 145 - {...register("provider")} 147 + {...providerRegister} 148 + onChange={(e) => { 149 + onProviderChange(e); 150 + setValue("apiKey", ""); 151 + }} 146 152 className="select select-lg font-medium text-[15px]" 147 153 > 148 154 <option value="cloudflare">