mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-20 04:30:17 +09:00
Merge pull request #5462 from JuliusMoehring/main
fix: Avoid fetching prompts.json serverside
This commit is contained in:
commit
b5ba05dd83
@ -1,7 +1,7 @@
|
|||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import { getLang } from "../locales";
|
|
||||||
import { StoreKey } from "../constant";
|
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
|
import { StoreKey } from "../constant";
|
||||||
|
import { getLang } from "../locales";
|
||||||
import { createPersistStore } from "../utils/store";
|
import { createPersistStore } from "../utils/store";
|
||||||
|
|
||||||
export interface Prompt {
|
export interface Prompt {
|
||||||
@ -147,6 +147,11 @@ export const usePromptStore = createPersistStore(
|
|||||||
},
|
},
|
||||||
|
|
||||||
onRehydrateStorage(state) {
|
onRehydrateStorage(state) {
|
||||||
|
// Skip store rehydration on server side
|
||||||
|
if (typeof window === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const PROMPT_URL = "./prompts.json";
|
const PROMPT_URL = "./prompts.json";
|
||||||
|
|
||||||
type PromptList = Array<[string, string]>;
|
type PromptList = Array<[string, string]>;
|
||||||
|
Loading…
Reference in New Issue
Block a user