diff --git a/packages/desktop/src/components/ConversationDetails.tsx b/packages/desktop/src/components/ConversationDetails.tsx index 7eff861..44a989c 100644 --- a/packages/desktop/src/components/ConversationDetails.tsx +++ b/packages/desktop/src/components/ConversationDetails.tsx @@ -19,12 +19,16 @@ import { } from '@mui/material'; import { FiSun, FiMoreVertical, FiPlay, FiCloudRain } from 'react-icons/fi'; import ConversationLabel from '../subcomponents/ConversationLabel'; +import { useRendersCount } from 'react-use'; export default function ConversationDetails() { const { user } = useAuth(); const { getUser, selectedConversation, selectConversation, isCloudDoingMagic } = useTerminal(); const [conversationUsers, setConversationUsers] = useImmer([]); + const rendersCount = useRendersCount(); + console.warn('RENDER COUNT | CONVERSATION DETAILS | ', rendersCount); + // TODO: at the terminal level, make sure we are listening for audio clips // and here it's just an access of that map of content for each conversation's blocks diff --git a/packages/desktop/src/components/ConversationList.tsx b/packages/desktop/src/components/ConversationList.tsx index 2b79748..0e67821 100644 --- a/packages/desktop/src/components/ConversationList.tsx +++ b/packages/desktop/src/components/ConversationList.tsx @@ -23,7 +23,7 @@ import { import { blueGrey } from '@mui/material/colors'; import { FiActivity, FiInbox, FiSearch, FiUsers, FiCoffee, FiCircle } from 'react-icons/fi'; import NirvanaAvatar from './NirvanaAvatar'; -import { useDebounce, useKey } from 'react-use'; +import { useDebounce, useKey, useRendersCount } from 'react-use'; import { useSnackbar } from 'notistack'; import KeyboardShortcutLabel from './KeyboardShortcutLabel'; import { searchUsers } from '../firebase/firestore'; @@ -42,6 +42,9 @@ import ConversationLabel from '../subcomponents/ConversationLabel'; export function ConversationList({ lookingForSomeone = false }: { lookingForSomeone: boolean }) { const { conversationMap } = useTerminal(); + const rendersCount = useRendersCount(); + console.warn('RENDER COUNT | CONVERSATION LIST | ', rendersCount); + if (Object.keys(conversationMap).length === 0) { return ( @@ -93,6 +96,9 @@ function ConversationRow({ conversation }: { conversation: Conversation }) { const [conversationUsers, setConversationUsers] = useImmer([]); + const rendersCount = useRendersCount(); + console.warn('RENDER COUNT | CONVERSATION LIST ROW | ', rendersCount); + useEffect(() => { (async () => { const userPromises = conversation.memberIdsList diff --git a/packages/desktop/src/components/MainPanel.tsx b/packages/desktop/src/components/MainPanel.tsx index 4441f2a..fc5acb4 100644 --- a/packages/desktop/src/components/MainPanel.tsx +++ b/packages/desktop/src/components/MainPanel.tsx @@ -5,6 +5,8 @@ import useAuth from '../providers/AuthProvider'; import ConversationDetails from './ConversationDetails'; import useTerminal from './Terminal'; +import { useRendersCount } from 'react-use'; + export default function MainPanel() { const { user } = useAuth(); const { selectedConversation, createConversationMode } = useTerminal(); @@ -15,6 +17,9 @@ export default function MainPanel() { // show who is + const rendersCount = useRendersCount(); + console.warn('RENDER COUNT | MAINPANEL | ', rendersCount); + const pageContent = useMemo(() => { if (selectedConversation) return ; diff --git a/packages/desktop/src/components/Navbar.tsx b/packages/desktop/src/components/Navbar.tsx index b4356a0..e711734 100644 --- a/packages/desktop/src/components/Navbar.tsx +++ b/packages/desktop/src/components/Navbar.tsx @@ -20,7 +20,7 @@ import useAuth from '../providers/AuthProvider'; import { blueGrey } from '@mui/material/colors'; import KeyboardShortcutLabel from './KeyboardShortcutLabel'; import { useSnackbar } from 'notistack'; -import { useKeyPressEvent } from 'react-use'; +import { useKeyPressEvent, useRendersCount } from 'react-use'; import useTerminal from './Terminal'; const Navbar = ({ @@ -44,6 +44,9 @@ const Navbar = ({ useKeyPressEvent('Shift', onSearchFocus); + const rendersCount = useRendersCount(); + console.warn('RENDER COUNT | NAVBAR | ', rendersCount); + return (