Skip to content

Commit

Permalink
Merge pull request #5462 from JuliusMoehring/main
Browse files Browse the repository at this point in the history
fix: Avoid fetching prompts.json serverside
  • Loading branch information
Dogtiti authored Sep 19, 2024
2 parents a8c70d8 + accb526 commit b5ba05d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/store/prompt.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuse from "fuse.js";
import { getLang } from "../locales";
import { StoreKey } from "../constant";
import { nanoid } from "nanoid";
import { StoreKey } from "../constant";
import { getLang } from "../locales";
import { createPersistStore } from "../utils/store";

export interface Prompt {
Expand Down Expand Up @@ -147,6 +147,11 @@ export const usePromptStore = createPersistStore(
},

onRehydrateStorage(state) {
// Skip store rehydration on server side
if (typeof window === "undefined") {
return;
}

const PROMPT_URL = "./prompts.json";

type PromptList = Array<[string, string]>;
Expand Down

0 comments on commit b5ba05d

Please sign in to comment.