jbilcke-hf HF staff commited on
Commit
4e03ac8
·
1 Parent(s): d67c1ff

fix me maybe

Browse files
src/app/interface/top-menu/index.tsx CHANGED
@@ -11,6 +11,7 @@ export function TopMenu() {
11
  const prompt = useStore(state => state.prompt)
12
 
13
  const setPrompt = useStore(state => state.setPrompt)
 
14
 
15
  const isLoading = useStore(state => state.isLoading)
16
  const setLoading = useStore(state => state.setLoading)
@@ -24,6 +25,16 @@ export function TopMenu() {
24
  const handleSubmit = () => {
25
  const promptChanged = draftPrompt.trim() !== prompt.trim()
26
  if (!isLoading && (promptChanged)) {
 
 
 
 
 
 
 
 
 
 
27
  setPrompt(draftPrompt)
28
  }
29
  }
 
11
  const prompt = useStore(state => state.prompt)
12
 
13
  const setPrompt = useStore(state => state.setPrompt)
14
+ const setRendered = useStore(state => state.setRendered)
15
 
16
  const isLoading = useStore(state => state.isLoading)
17
  const setLoading = useStore(state => state.setLoading)
 
25
  const handleSubmit = () => {
26
  const promptChanged = draftPrompt.trim() !== prompt.trim()
27
  if (!isLoading && (promptChanged)) {
28
+ // important: we reset!
29
+ setRendered({
30
+ renderId: "",
31
+ status: "pending",
32
+ assetUrl: "",
33
+ alt: "",
34
+ error: "",
35
+ maskUrl: "",
36
+ segments: []
37
+ })
38
  setPrompt(draftPrompt)
39
  }
40
  }