fixed build error
This commit is contained in:
@@ -12,8 +12,8 @@ export default function ChatList() {
|
||||
const router = useRouter();
|
||||
|
||||
const [list, setList] = useState([]);
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount');
|
||||
const accountProfile = JSON.parse(activeAccount.metadata);
|
||||
const [activeAccount]: any = useLocalStorage('activeAccount', {});
|
||||
const profile = activeAccount.metadata ? JSON.parse(activeAccount.metadata) : null;
|
||||
|
||||
const openSelfChat = () => {
|
||||
router.push({
|
||||
@@ -41,7 +41,7 @@ export default function ChatList() {
|
||||
>
|
||||
<div className="relative h-5 w-5 shrink overflow-hidden rounded bg-white">
|
||||
<ImageWithFallback
|
||||
src={accountProfile.picture || DEFAULT_AVATAR}
|
||||
src={profile?.picture || DEFAULT_AVATAR}
|
||||
alt={activeAccount.pubkey}
|
||||
fill={true}
|
||||
className="rounded object-cover"
|
||||
@@ -49,7 +49,7 @@ export default function ChatList() {
|
||||
</div>
|
||||
<div>
|
||||
<h5 className="text-sm font-medium text-zinc-400">
|
||||
{accountProfile.display_name || accountProfile.name} <span className="text-zinc-500">(you)</span>
|
||||
{profile?.display_name || profile?.name} <span className="text-zinc-500">(you)</span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user