enzostvs HF Staff commited on
Commit
fdd9b16
·
1 Parent(s): b706925

error: keep style

Browse files
components/main/hooks/useInputGeneration.ts CHANGED
@@ -9,7 +9,6 @@ import { useCollection } from "@/components/modal/useCollection";
9
  export const useInputGeneration = () => {
10
  const { setOpen } = useCollection();
11
  const [myGenerationsId, setGenerationsId] = useLocalStorage<any>('my-own-generations', []);
12
- const [style, setStyle] = useState<string>(list_styles[0].name)
13
 
14
  const { data: prompt } = useQuery(["prompt"], () => {
15
  return ''
@@ -21,6 +20,17 @@ export const useInputGeneration = () => {
21
  })
22
  const setPrompt = (str:string) => client.setQueryData(["prompt"], () => str)
23
 
 
 
 
 
 
 
 
 
 
 
 
24
  const client = useQueryClient()
25
 
26
  const { mutate: submit, isLoading: loading } = useMutation(
 
9
  export const useInputGeneration = () => {
10
  const { setOpen } = useCollection();
11
  const [myGenerationsId, setGenerationsId] = useLocalStorage<any>('my-own-generations', []);
 
12
 
13
  const { data: prompt } = useQuery(["prompt"], () => {
14
  return ''
 
20
  })
21
  const setPrompt = (str:string) => client.setQueryData(["prompt"], () => str)
22
 
23
+ const { data: style } = useQuery(["style"], () => {
24
+ return list_styles[0].name
25
+ }, {
26
+ refetchOnWindowFocus: false,
27
+ refetchOnMount: false,
28
+ refetchOnReconnect: false,
29
+ initialData: ''
30
+ })
31
+
32
+ const setStyle = (str:string) => client.setQueryData(["style"], () => str)
33
+
34
  const client = useQueryClient()
35
 
36
  const { mutate: submit, isLoading: loading } = useMutation(