support ssr when build app
This commit is contained in:
@@ -2,7 +2,7 @@ import { createContext } from 'react';
|
||||
|
||||
export const AccountContext = createContext({});
|
||||
|
||||
let activeAccount: any = null;
|
||||
let activeAccount: any = { id: '', pubkey: '', follows: null, metadata: '' };
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
const { getActiveAccount } = await import('@utils/storage');
|
||||
|
||||
@@ -17,7 +17,7 @@ export default function EventCollector() {
|
||||
const activeAccount: any = useContext(AccountContext);
|
||||
|
||||
const setHasNewerNote = useSetAtom(hasNewerNoteAtom);
|
||||
const follows = activeAccount ? JSON.parse(activeAccount.follows) : [];
|
||||
const follows = activeAccount.follows ? JSON.parse(activeAccount.follows) : [];
|
||||
|
||||
const now = useRef(new Date());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user