Spaces:
Runtime error
Runtime error
Esteves Enzo
commited on
Commit
·
6f0b822
1
Parent(s):
4a320f9
hide header after generating first image
Browse files
components/main/hooks/useCollections.ts
CHANGED
|
@@ -11,6 +11,8 @@ export const useCollections = () => {
|
|
| 11 |
const response = await fetch("/api/collections", { method: "GET" })
|
| 12 |
const data = await response.json()
|
| 13 |
|
|
|
|
|
|
|
| 14 |
if (!response.ok) {
|
| 15 |
throw new Error(data.message)
|
| 16 |
}
|
|
@@ -19,7 +21,7 @@ export const useCollections = () => {
|
|
| 19 |
{
|
| 20 |
refetchOnMount: false,
|
| 21 |
refetchOnWindowFocus: false,
|
| 22 |
-
refetchOnReconnect: false,
|
| 23 |
}
|
| 24 |
);
|
| 25 |
|
|
|
|
| 11 |
const response = await fetch("/api/collections", { method: "GET" })
|
| 12 |
const data = await response.json()
|
| 13 |
|
| 14 |
+
console.log(data)
|
| 15 |
+
|
| 16 |
if (!response.ok) {
|
| 17 |
throw new Error(data.message)
|
| 18 |
}
|
|
|
|
| 21 |
{
|
| 22 |
refetchOnMount: false,
|
| 23 |
refetchOnWindowFocus: false,
|
| 24 |
+
refetchOnReconnect: false,
|
| 25 |
}
|
| 26 |
);
|
| 27 |
|
components/main/hooks/useInputGeneration.ts
CHANGED
|
@@ -46,8 +46,17 @@ export const useInputGeneration = () => {
|
|
| 46 |
},
|
| 47 |
)
|
| 48 |
|
| 49 |
-
const { data: hasMadeFirstGeneration } = useQuery(["firstGenerationDone"], () =>
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
return {
|
| 53 |
prompt,
|
|
|
|
| 46 |
},
|
| 47 |
)
|
| 48 |
|
| 49 |
+
const { data: hasMadeFirstGeneration } = useQuery(["firstGenerationDone"], () => {
|
| 50 |
+
return false
|
| 51 |
+
}, {
|
| 52 |
+
refetchOnWindowFocus: false,
|
| 53 |
+
refetchOnMount: false,
|
| 54 |
+
refetchOnReconnect: false,
|
| 55 |
+
initialData: false
|
| 56 |
+
})
|
| 57 |
+
const setFirstGenerationDone = () => {
|
| 58 |
+
client.setQueryData(["firstGenerationDone"], () => true)
|
| 59 |
+
}
|
| 60 |
|
| 61 |
return {
|
| 62 |
prompt,
|
prisma/migrations/20231026232249_init/migration.sql
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
-- CreateTable
|
| 2 |
+
CREATE TABLE "Image" (
|
| 3 |
+
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
| 4 |
+
"prompt" TEXT NOT NULL,
|
| 5 |
+
"blob" BLOB NOT NULL
|
| 6 |
+
);
|
prisma/migrations/migration_lock.toml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Please do not edit this file manually
|
| 2 |
+
# It should be added in your version-control system (i.e. Git)
|
| 3 |
+
provider = "sqlite"
|