mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-24 22:50:22 +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 = {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Cache-Control": "no-store",
|
||||
Authorization: authValue,
|
||||
...(process.env.OPENAI_ORG_ID && {
|
||||
"OpenAI-Organization": process.env.OPENAI_ORG_ID,
|
||||
}),
|
||||
},
|
||||
cache: "no-store",
|
||||
method: req.method,
|
||||
body: req.body,
|
||||
// @ts-ignore
|
||||
|
@ -109,7 +109,7 @@ export const useMaskStore = create<MaskStore>()(
|
||||
}),
|
||||
{
|
||||
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<MaskStore>()(
|
||||
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;
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user