mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-25 07:00:23 +09:00
Merge branch 'Yidadaa:main' into main
This commit is contained in:
commit
be560a7485
@ -35,12 +35,12 @@ export async function requestOpenai(req: NextRequest) {
|
|||||||
const fetchOptions: RequestInit = {
|
const fetchOptions: RequestInit = {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
"Cache-Control": "no-store",
|
||||||
Authorization: authValue,
|
Authorization: authValue,
|
||||||
...(process.env.OPENAI_ORG_ID && {
|
...(process.env.OPENAI_ORG_ID && {
|
||||||
"OpenAI-Organization": process.env.OPENAI_ORG_ID,
|
"OpenAI-Organization": process.env.OPENAI_ORG_ID,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
cache: "no-store",
|
|
||||||
method: req.method,
|
method: req.method,
|
||||||
body: req.body,
|
body: req.body,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -109,7 +109,7 @@ export const useMaskStore = create<MaskStore>()(
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: StoreKey.Mask,
|
name: StoreKey.Mask,
|
||||||
version: 3,
|
version: 3.1,
|
||||||
|
|
||||||
migrate(state, version) {
|
migrate(state, version) {
|
||||||
const newState = JSON.parse(JSON.stringify(state)) as MaskState;
|
const newState = JSON.parse(JSON.stringify(state)) as MaskState;
|
||||||
@ -119,6 +119,14 @@ export const useMaskStore = create<MaskStore>()(
|
|||||||
Object.values(newState.masks).forEach((m) => (m.id = nanoid()));
|
Object.values(newState.masks).forEach((m) => (m.id = nanoid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version < 3.1) {
|
||||||
|
const updatedMasks: Record<string, Mask> = {};
|
||||||
|
Object.values(newState.masks).forEach((m) => {
|
||||||
|
updatedMasks[m.id] = m;
|
||||||
|
});
|
||||||
|
newState.masks = updatedMasks;
|
||||||
|
}
|
||||||
|
|
||||||
return newState as any;
|
return newState as any;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user