clean up and fix errors

This commit is contained in:
Ren Amamiya
2023-04-19 08:50:32 +07:00
parent c72798507e
commit 697caca77b
13 changed files with 83 additions and 78 deletions

View File

@@ -15,15 +15,15 @@ export default function ChatList() {
const [list, setList] = useState([]);
const [activeAccount]: any = useLocalStorage('account', {});
const profile = activeAccount.metadata ? JSON.parse(activeAccount.metadata) : null;
const profile = JSON.parse(activeAccount.metadata);
const openSelfChat = () => {
router.push(`/chats/${activeAccount.pubkey}`);
router.push(`/nostr/chats/${activeAccount.pubkey}`);
};
useEffect(() => {
getChats(activeAccount.id)
.then((res) => setList(res))
.then((res: any) => setList(res))
.catch(console.error);
}, [activeAccount.id]);