From f868f9cb126b16101066c25288466b92cf19cd0e Mon Sep 17 00:00:00 2001 From: MostafaHasan <mostafahasan.eng@gmail.com> Date: Wed, 26 Oct 2022 04:28:46 +0200 Subject: [PATCH] remove comments --- components/common/LeftSideBar/LeftSideBar.tsx | 19 ++++--------------- .../ChannelActionsView/ChannelActionsView.tsx | 3 +-- contexts/network-client-context.tsx | 4 ---- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/components/common/LeftSideBar/LeftSideBar.tsx b/components/common/LeftSideBar/LeftSideBar.tsx index e6576249..ea85e532 100644 --- a/components/common/LeftSideBar/LeftSideBar.tsx +++ b/components/common/LeftSideBar/LeftSideBar.tsx @@ -8,11 +8,7 @@ import { } from "@components/common"; import { Elixxir, SpeakEasy, Settings, Plus, Join } from "@components/icons"; import { useUI } from "contexts/ui-context"; -import { - useNetworkClient, - IChannel, - NetworkStatus -} from "contexts/network-client-context"; +import { useNetworkClient } from "contexts/network-client-context"; const LeftSideBar: FC<{ cssClasses?: string; @@ -23,7 +19,6 @@ const LeftSideBar: FC<{ currentChannel, channels, setCurrentChannel, - networkStatus, getIdentity, getVersion, getClientVersion @@ -46,31 +41,25 @@ const LeftSideBar: FC<{ <div className="flex items-center"> <Plus - className={cn("mr-1", s.plus, { - // [s.plus__disabled]: networkStatus !== NetworkStatus.CONNECTED - })} + className={cn("mr-1", s.plus, {})} onClick={(e: any) => { if (e && e.stopPropagation) { e.stopPropagation(); } - // if (networkStatus === NetworkStatus.CONNECTED) { + setModalView("CREATE_CHANNEL"); openModal(); // } }} /> <Join - className={cn(s.join, { - // [s.join__disabled]: networkStatus !== NetworkStatus.CONNECTED - })} + className={cn(s.join, {})} onClick={(e: any) => { if (e && e.stopPropagation) { e.stopPropagation(); } - // if (networkStatus === NetworkStatus.CONNECTED) { setModalView("JOIN_CHANNEL"); openModal(); - // } }} /> </div> diff --git a/components/common/Modal/ModalViews/ChannelActionsView/ChannelActionsView.tsx b/components/common/Modal/ModalViews/ChannelActionsView/ChannelActionsView.tsx index 50c07954..44be2d6b 100644 --- a/components/common/Modal/ModalViews/ChannelActionsView/ChannelActionsView.tsx +++ b/components/common/Modal/ModalViews/ChannelActionsView/ChannelActionsView.tsx @@ -9,7 +9,7 @@ import { import { useUI } from "contexts/ui-context"; const ChannelActionsView: FC<{}> = ({}) => { - const { currentChannel, networkStatus } = useNetworkClient(); + const { currentChannel } = useNetworkClient(); const { setModalView, openModal } = useUI(); return ( @@ -26,7 +26,6 @@ const ChannelActionsView: FC<{}> = ({}) => { setModalView("JOIN_CHANNEL"); openModal(); }} - disabled={networkStatus !== NetworkStatus.CONNECTED} /> <ModalCtaButton buttonCopy="Leave" diff --git a/contexts/network-client-context.tsx b/contexts/network-client-context.tsx index 1e169e1d..e7007597 100644 --- a/contexts/network-client-context.tsx +++ b/contexts/network-client-context.tsx @@ -1012,10 +1012,6 @@ export const NetworkProvider: FC<any> = props => { privacyLevel: 0 | 2 ) => { return new Promise(async (resolve, reject) => { - if (network && networkStatus !== NetworkStatus.CONNECTED) { - reject("Network is not connected yet"); - } - if (channelName && utils?.GenerateChannel) { try { const channelUnparsed = utils?.GenerateChannel( -- GitLab