Update Terminal.tsx
This commit is contained in:
@@ -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;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user