fixed build errors
This commit is contained in:
@@ -4,6 +4,6 @@ import { getActiveAccount } from '@utils/storage';
|
||||
import { atomWithCache } from 'jotai-cache';
|
||||
|
||||
export const activeAccountAtom = atomWithCache(async () => {
|
||||
const response = isSSR ? null : await getActiveAccount();
|
||||
const response = isSSR ? {} : await getActiveAccount();
|
||||
return response;
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isSSR } from '@utils/ssr';
|
||||
import { getAllNotes } from '@utils/storage';
|
||||
|
||||
import { atom } from 'jotai';
|
||||
@@ -9,7 +10,7 @@ export const hasNewerNoteAtom = atom(false);
|
||||
export const [notesAtom] = atomsWithQuery(() => ({
|
||||
queryKey: ['notes'],
|
||||
queryFn: async ({ queryKey: [] }) => {
|
||||
const res = await getAllNotes();
|
||||
const res = isSSR ? [] : await getAllNotes();
|
||||
return res;
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -4,6 +4,6 @@ import { getAllRelays } from '@utils/storage';
|
||||
import { atomWithCache } from 'jotai-cache';
|
||||
|
||||
export const relaysAtom = atomWithCache(async () => {
|
||||
const response = isSSR ? null : await getAllRelays();
|
||||
const response = isSSR ? [] : await getAllRelays();
|
||||
return response;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user