From 7a0b437626a238c3d01d910fd5cd23c302562d85 Mon Sep 17 00:00:00 2001 From: yuanliang feng <10550655+fyl080801@users.noreply.github.com> Date: Mon, 10 Jul 2023 17:26:28 +0800 Subject: [PATCH 1/3] Update common.ts --- app/api/common.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/api/common.ts b/app/api/common.ts index 30d5e0daf..3bfe208b4 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -40,7 +40,6 @@ export async function requestOpenai(req: NextRequest) { "OpenAI-Organization": process.env.OPENAI_ORG_ID, }), }, - cache: "no-store", method: req.method, body: req.body, // @ts-ignore From a832cfb343db0d8c2ed91222ce98745265f9c07a Mon Sep 17 00:00:00 2001 From: yuanliang feng <10550655+fyl080801@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:46:40 +0800 Subject: [PATCH 2/3] Update common.ts --- app/api/common.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/common.ts b/app/api/common.ts index 3bfe208b4..6d6a7d1fb 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -35,6 +35,7 @@ export async function requestOpenai(req: NextRequest) { const fetchOptions: RequestInit = { headers: { "Content-Type": "application/json", + "Cache-Control": "no-store", Authorization: authValue, ...(process.env.OPENAI_ORG_ID && { "OpenAI-Organization": process.env.OPENAI_ORG_ID, From a4d012828c55b308e2ea0c57a250d0ac3709d02c Mon Sep 17 00:00:00 2001 From: imldy Date: Tue, 11 Jul 2023 21:02:09 +0800 Subject: [PATCH 3/3] fix: migrated mask object key --- app/store/mask.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/store/mask.ts b/app/store/mask.ts index 105ca3469..02132b77d 100644 --- a/app/store/mask.ts +++ b/app/store/mask.ts @@ -109,7 +109,7 @@ export const useMaskStore = create()( }), { name: StoreKey.Mask, - version: 3, + version: 3.1, migrate(state, version) { const newState = JSON.parse(JSON.stringify(state)) as MaskState; @@ -119,6 +119,14 @@ export const useMaskStore = create()( Object.values(newState.masks).forEach((m) => (m.id = nanoid())); } + if (version < 3.1) { + const updatedMasks: Record = {}; + Object.values(newState.masks).forEach((m) => { + updatedMasks[m.id] = m; + }); + newState.masks = updatedMasks; + } + return newState as any; }, },