Skip to content

Commit

Permalink
feat: try catch indexedDB error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogtiti committed Aug 27, 2024
1 parent c2fc0b4 commit 7b6fe66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/utils/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { create } from "zustand";
import { combine, persist, createJSONStorage } from "zustand/middleware";
import { Updater } from "../typing";
import { deepClone } from "./clone";
import { indexDBStorage } from "@/app/utils/indexDB-storage";
import { indexedDBStorage } from "@/app/utils/indexedDB-storage";

type SecondParam<T> = T extends (
_f: infer _F,
Expand Down Expand Up @@ -32,7 +32,7 @@ export function createPersistStore<T extends object, M>(
) => M,
persistOptions: SecondParam<typeof persist<T & M & MakeUpdater<T>>>,
) {
persistOptions.storage = createJSONStorage(() => indexDBStorage);
persistOptions.storage = createJSONStorage(() => indexedDBStorage);
return create(
persist(
combine(
Expand Down

0 comments on commit 7b6fe66

Please sign in to comment.