From b7d7326baee3f89ea355d941892adefde2654a30 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Wed, 2 Jun 2021 11:29:11 -0700 Subject: [PATCH] Differentiate connectivity and auth related errors Summary: Cleaning up login session and connectivity handling. Reviewed By: passy Differential Revision: D28795342 fbshipit-source-id: ddc659d681f730c7183f364d8924e5c680f8a418 --- desktop/app/src/sandy-chrome/LeftRail.tsx | 24 +---------------------- desktop/app/src/utils/errors.tsx | 22 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/desktop/app/src/sandy-chrome/LeftRail.tsx b/desktop/app/src/sandy-chrome/LeftRail.tsx index e8c610a97..c6076042b 100644 --- a/desktop/app/src/sandy-chrome/LeftRail.tsx +++ b/desktop/app/src/sandy-chrome/LeftRail.tsx @@ -7,13 +7,7 @@ * @format */ -import React, { - cloneElement, - useState, - useCallback, - useMemo, - useEffect, -} from 'react'; +import React, {cloneElement, useState, useCallback, useMemo} from 'react'; import {Button, Divider, Badge, Tooltip, Avatar, Popover} from 'antd'; import { MobileFilled, @@ -50,7 +44,6 @@ import {showEmulatorLauncher} from './appinspect/LaunchEmulator'; import SupportRequestFormV2 from '../fb-stubs/SupportRequestFormV2'; import {setStaticView, StaticView} from '../reducers/connections'; import {getInstance} from '../fb-stubs/Logger'; -import {getUser} from '../fb-stubs/user'; import {SandyRatingButton} from '../chrome/RatingButton'; import {filterNotifications} from './notification/notificationUtils'; import {useMemoize} from 'flipper-plugin'; @@ -58,7 +51,6 @@ import isProduction from '../utils/isProduction'; import NetworkGraph from '../chrome/NetworkGraph'; import FpsGraph from '../chrome/FpsGraph'; import UpdateIndicator from '../chrome/UpdateIndicator'; -import {UserNotSignedInError, UserUnauthorizedError} from '../utils/errors'; const LeftRailButtonElem = styled(Button)<{kind?: 'small'}>(({kind}) => ({ width: kind === 'small' ? 32 : 36, @@ -379,20 +371,6 @@ function LoginButton() { [], ); - useEffect(() => { - if (config.showLogin) { - getUser().catch((error) => { - if ( - error instanceof UserUnauthorizedError || - error instanceof UserNotSignedInError - ) { - showLogin(); - } - }); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - return login ? (