jbilcke-hf HF staff commited on
Commit
66d8bb7
β€’
1 Parent(s): 93303c1

trying a fix

Browse files
src/app/interface/bottom-bar/index.tsx CHANGED
@@ -53,30 +53,27 @@ export function BottomBar() {
53
  return (
54
  <div className={cn(
55
  `print:hidden`,
56
- `fixed bottom-6 right-6`,
57
  `flex flex-row`,
58
  `animation-all duration-300 ease-in-out`,
59
  isGeneratingStory ? `scale-0 opacity-0` : ``,
60
  `space-x-3`,
 
61
  )}>
62
- {/*
63
  <div>
64
  <Button
65
  onClick={handlePrint}
66
  disabled={!prompt?.length}
67
- >{
68
- remainingImages ? `${allStatus.length - remainingImages}/4 panels βŒ›` : `Print as PDF`
69
- // remainingImages ? `Print (${allStatus.length - remainingImages}/4 in HD βŒ›)` : `Print (in HD)`
70
-
71
- }</Button>
72
  </div>
73
- */}
74
  <div>
75
  <Button
76
  onClick={download}
77
  disabled={!prompt?.length}
78
  >{
79
- remainingImages ? `${allStatus.length - remainingImages}/4 panels βŒ›` : `Download`
80
  }</Button>
81
  </div>
82
  <div>
 
53
  return (
54
  <div className={cn(
55
  `print:hidden`,
56
+ `fixed bottom-6 right-3`,
57
  `flex flex-row`,
58
  `animation-all duration-300 ease-in-out`,
59
  isGeneratingStory ? `scale-0 opacity-0` : ``,
60
  `space-x-3`,
61
+ `scale-[0.9]`
62
  )}>
 
63
  <div>
64
  <Button
65
  onClick={handlePrint}
66
  disabled={!prompt?.length}
67
+ >
68
+ Print
69
+ </Button>
 
 
70
  </div>
 
71
  <div>
72
  <Button
73
  onClick={download}
74
  disabled={!prompt?.length}
75
  >{
76
+ remainingImages ? `${allStatus.length - remainingImages}/4 panels βŒ›` : `Save`
77
  }</Button>
78
  </div>
79
  <div>
src/app/interface/panel/index.tsx CHANGED
@@ -98,7 +98,7 @@ export function Panel({
98
  clearTimeout(timeoutRef.current)
99
 
100
  if (!renderedRef.current?.renderId || renderedRef.current?.status !== "pending") {
101
- timeoutRef.current = setTimeout(checkStatus, 1500)
102
  return
103
  }
104
  try {
@@ -116,14 +116,14 @@ export function Panel({
116
 
117
  if (newRendered.status === "pending") {
118
  // console.log("job not finished")
119
- timeoutRef.current = setTimeout(checkStatus, 1500)
120
  } else {
121
  console.log("panel finished!")
122
  setGeneratingImages(panel, false)
123
  }
124
  } catch (err) {
125
  console.error(err)
126
- timeoutRef.current = setTimeout(checkStatus, 1500)
127
  }
128
  })
129
  }
 
98
  clearTimeout(timeoutRef.current)
99
 
100
  if (!renderedRef.current?.renderId || renderedRef.current?.status !== "pending") {
101
+ timeoutRef.current = setTimeout(checkStatus, 2500)
102
  return
103
  }
104
  try {
 
116
 
117
  if (newRendered.status === "pending") {
118
  // console.log("job not finished")
119
+ timeoutRef.current = setTimeout(checkStatus, 2500)
120
  } else {
121
  console.log("panel finished!")
122
  setGeneratingImages(panel, false)
123
  }
124
  } catch (err) {
125
  console.error(err)
126
+ timeoutRef.current = setTimeout(checkStatus, 2500)
127
  }
128
  })
129
  }
src/app/main.tsx CHANGED
@@ -105,7 +105,7 @@ export default function Main() {
105
  setTimeout(() => {
106
  setGeneratingStory(false)
107
  setWaitABitMore(false)
108
- }, 10000)
109
  }
110
  })
111
  }, [prompt, preset?.label]) // important: we need to react to preset changes too
 
105
  setTimeout(() => {
106
  setGeneratingStory(false)
107
  setWaitABitMore(false)
108
+ }, 12000)
109
  }
110
  })
111
  }, [prompt, preset?.label]) // important: we need to react to preset changes too
src/app/store/index.ts CHANGED
@@ -126,7 +126,7 @@ export const useStore = create<{
126
  const canvas = await html2canvas(page)
127
  console.log("canvas:", canvas)
128
 
129
- const data = canvas.toDataURL('image/jpg')
130
  return data
131
  },
132
  download: async () => {
 
126
  const canvas = await html2canvas(page)
127
  console.log("canvas:", canvas)
128
 
129
+ const data = canvas.toDataURL('image/jpeg', 0.5)
130
  return data
131
  },
132
  download: async () => {