Update Terminal.tsx

This commit is contained in:
talksik
2022-05-29 12:44:20 -05:00
parent fe21175c7a
commit 74a32679be
+2 -3
View File
@@ -185,9 +185,8 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
useEffect(() => { useEffect(() => {
// go through all conversations // go through all conversations
Object.keys(conversationMap).forEach((conversationId) => { Object.keys(conversationMap).forEach((conversationId) => {
setContentListeners((draftListeners) => {
// if we have a listener for conversation already, then just move on // if we have a listener for conversation already, then just move on
if (draftListeners[conversationId]) return; if (contentListeners[conversationId]) return;
// if we don't, then create one for this conversation // if we don't, then create one for this conversation
const contentListener = onSnapshot( const contentListener = onSnapshot(
@@ -218,7 +217,7 @@ export function TerminalProvider({ children }: { children?: React.ReactNode }) {
); );
//add to map of listeners //add to map of listeners
setContentListeners((draftListeners) => {
draftListeners[conversationId] = contentListener; draftListeners[conversationId] = contentListener;
}); });
}); });