ChatWidget: remove 'direct' streaming (it uses the 'user' stream)
This commit is contained in:
parent
1a4a6382d3
commit
2e728d99f9
1 changed files with 2 additions and 12 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue