mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-19 20:20:16 +09:00
feat: try catch indexedDB error
This commit is contained in:
parent
c2fc0b4979
commit
7b6fe66f2a
@ -2,7 +2,7 @@ import { create } from "zustand";
|
|||||||
import { combine, persist, createJSONStorage } from "zustand/middleware";
|
import { combine, persist, createJSONStorage } from "zustand/middleware";
|
||||||
import { Updater } from "../typing";
|
import { Updater } from "../typing";
|
||||||
import { deepClone } from "./clone";
|
import { deepClone } from "./clone";
|
||||||
import { indexDBStorage } from "@/app/utils/indexDB-storage";
|
import { indexedDBStorage } from "@/app/utils/indexedDB-storage";
|
||||||
|
|
||||||
type SecondParam<T> = T extends (
|
type SecondParam<T> = T extends (
|
||||||
_f: infer _F,
|
_f: infer _F,
|
||||||
@ -32,7 +32,7 @@ export function createPersistStore<T extends object, M>(
|
|||||||
) => M,
|
) => M,
|
||||||
persistOptions: SecondParam<typeof persist<T & M & MakeUpdater<T>>>,
|
persistOptions: SecondParam<typeof persist<T & M & MakeUpdater<T>>>,
|
||||||
) {
|
) {
|
||||||
persistOptions.storage = createJSONStorage(() => indexDBStorage);
|
persistOptions.storage = createJSONStorage(() => indexedDBStorage);
|
||||||
return create(
|
return create(
|
||||||
persist(
|
persist(
|
||||||
combine(
|
combine(
|
||||||
|
Loading…
Reference in New Issue
Block a user