fixed ssr errors

This commit is contained in:
Ren Amamiya
2023-04-23 08:25:27 +07:00
parent b9bafc851e
commit 8b6bffcff2
14 changed files with 101 additions and 45 deletions

View File

@@ -11,7 +11,7 @@ import { useEffect, useState } from 'react';
export default function ChatList() {
const [list, setList] = useState([]);
const [activeAccount]: any = useLocalStorage('account', {});
const profile = JSON.parse(activeAccount.metadata);
const profile = activeAccount.metadata ? JSON.parse(activeAccount.metadata) : null;
useEffect(() => {
let ignore = false;