fix: safaLocalStorage

This commit is contained in:
Dogtiti
2024-09-08 13:23:40 +08:00
parent 23ac2efd89
commit 992c3a5d3a
8 changed files with 96 additions and 26 deletions

View File

@@ -1,5 +1,8 @@
import { StateStorage } from "zustand/middleware";
import { get, set, del, clear } from "idb-keyval";
import { safeLocalStorage } from "@/app/utils";
const localStorage = safeLocalStorage();
class IndexedDBStorage implements StateStorage {
public async getItem(name: string): Promise<string | null> {