Skip to content

Commit

Permalink
fix: load storage later
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkz committed Dec 26, 2024
1 parent b7c5e5e commit fc575d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { id } from 'at/options';
import { atomWithStorage, createJSONStorage } from 'jotai/utils';

function createAnkiDroidStorage() {
const as = getAnkiStorage();
const as: ReturnType<typeof getAnkiStorage> = new Promise((resolve) => {
setTimeout(() => {
resolve(getAnkiStorage());
}, 0);
});
const updaters = new Map<string, Array<(value: string | null) => void>>();

return createJSONStorage<any>(() => ({
Expand Down

0 comments on commit fc575d1

Please sign in to comment.