From 89c1225976e1ecd5e2915b78b44b3b334cccef37 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 22 Sep 2022 12:55:29 -0400 Subject: [PATCH] Hide widget if not onboarded --- app/soapbox/features/chats/components/chat-widget.tsx | 7 ++++++- app/soapbox/features/ui/index.tsx | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/chats/components/chat-widget.tsx b/app/soapbox/features/chats/components/chat-widget.tsx index 9f776bc61..6d444b07b 100644 --- a/app/soapbox/features/chats/components/chat-widget.tsx +++ b/app/soapbox/features/chats/components/chat-widget.tsx @@ -2,11 +2,12 @@ import React, { useEffect } from 'react'; import { connectDirectStream } from 'soapbox/actions/streaming'; import { ChatProvider } from 'soapbox/contexts/chat-context'; -import { useAppDispatch } from 'soapbox/hooks'; +import { useAppDispatch, useOwnAccount } from 'soapbox/hooks'; import ChatPane from './chat-pane/chat-pane'; const ChatWidget = () => { + const account = useOwnAccount(); const dispatch = useAppDispatch(); useEffect(() => { @@ -17,6 +18,10 @@ const ChatWidget = () => { }); }, []); + if (!account?.chats_onboarded) { + return null; + } + return ( diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 65b42ce61..d76c49756 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -679,6 +679,7 @@ const UI: React.FC = ({ children }) => { {Component => } )} + {me && features.chats && !mobile && ( {Component => }