fixed build error
This commit is contained in:
@@ -32,8 +32,8 @@ export const NoteComment = memo(function NoteComment({
|
||||
const [open, setOpen] = useState(false);
|
||||
const [value, setValue] = useState('');
|
||||
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount');
|
||||
const profile = JSON.parse(activeAccount.metadata);
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount', {});
|
||||
const profile = activeAccount.metadata ? JSON.parse(activeAccount.metadata) : null;
|
||||
|
||||
const openThread = () => {
|
||||
router.push(`/newsfeed/${eventID}`);
|
||||
@@ -87,7 +87,7 @@ export const NoteComment = memo(function NoteComment({
|
||||
<div>
|
||||
<div className="relative h-11 w-11 shrink-0 overflow-hidden rounded-md border border-white/10">
|
||||
<ImageWithFallback
|
||||
src={profile.picture}
|
||||
src={profile?.picture}
|
||||
alt="user's avatar"
|
||||
fill={true}
|
||||
className="rounded-md object-cover"
|
||||
|
||||
@@ -20,7 +20,7 @@ export const NoteReaction = memo(function NoteReaction({
|
||||
}) {
|
||||
const [pool, relays]: any = useContext(RelayContext);
|
||||
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount');
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount', {});
|
||||
const [isReact, setIsReact] = useState(false);
|
||||
const [like, setLike] = useState(0);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import reactStringReplace from 'react-string-replace';
|
||||
export const NoteParent = memo(function NoteParent({ id }: { id: string }) {
|
||||
const [pool, relays]: any = useContext(RelayContext);
|
||||
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount');
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount', {});
|
||||
const [event, setEvent] = useState(null);
|
||||
|
||||
const unsubscribe = useRef(null);
|
||||
|
||||
@@ -12,7 +12,7 @@ import reactStringReplace from 'react-string-replace';
|
||||
export const NoteRepost = memo(function NoteRepost({ id }: { id: string }) {
|
||||
const [pool, relays]: any = useContext(RelayContext);
|
||||
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount');
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount', {});
|
||||
const [event, setEvent] = useState(null);
|
||||
|
||||
const unsubscribe = useRef(null);
|
||||
|
||||
Reference in New Issue
Block a user