ChatWidget: remove 'direct' streaming (it uses the 'user' stream)

This commit is contained in:
Alex Gleason 2022-09-22 14:36:46 -05:00
parent 1a4a6382d3
commit 2e728d99f9
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,26 +1,16 @@
import React, { useEffect } from 'react'; import React from 'react';
import { connectDirectStream } from 'soapbox/actions/streaming';
import { ChatProvider } from 'soapbox/contexts/chat-context'; import { ChatProvider } from 'soapbox/contexts/chat-context';
import { useAppDispatch, useOwnAccount } from 'soapbox/hooks'; import { useOwnAccount } from 'soapbox/hooks';
import ChatPane from './chat-pane/chat-pane'; import ChatPane from './chat-pane/chat-pane';
const ChatWidget = () => { const ChatWidget = () => {
const account = useOwnAccount(); const account = useOwnAccount();
const dispatch = useAppDispatch();
const path = location.pathname; const path = location.pathname;
const shouldHideWidget = Boolean(path.match(/^\/chats/)); const shouldHideWidget = Boolean(path.match(/^\/chats/));
useEffect(() => {
const disconnect = dispatch(connectDirectStream());
return (() => {
disconnect();
});
}, []);
if (!account?.chats_onboarded || shouldHideWidget) { if (!account?.chats_onboarded || shouldHideWidget) {
return null; return null;
} }