From 340b286d39754724a3328a9c42fe24d06e76277a Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Sat, 30 Jan 2021 12:38:57 -0500 Subject: [PATCH 01/10] fetchActions: Fix recent regression in post-initial-fetch navigation. In e18124898, we forgot to change this instance of 'main' to 'main-tabs'. The symptom was that you could navigate somewhere in the app (e.g., to the message list) while the "Connecting..." banner was showing, then be interrupted when that banner disappeared by having the nav reset back to the home tab -- which was annoying. --- src/message/fetchActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/message/fetchActions.js b/src/message/fetchActions.js index aef9abc7305..f72ab5b0fbb 100644 --- a/src/message/fetchActions.js +++ b/src/message/fetchActions.js @@ -172,7 +172,7 @@ const initialFetchCompletePlain = (): Action => ({ }); export const initialFetchComplete = () => async (dispatch: Dispatch, getState: GetState) => { - if (!getNavigationRoutes().some(navigationRoute => navigationRoute.name === 'main')) { + if (!getNavigationRoutes().some(navigationRoute => navigationRoute.name === 'main-tabs')) { // If we're anywhere in the normal UI of the app, then remain // where we are. Only reset the nav state if we're elsewhere, // and in that case, go to the main screen. From 57343e8dad432acbde4ce2cb0d5de3024d22cba9 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Sat, 30 Jan 2021 12:43:33 -0500 Subject: [PATCH 02/10] nav: Fix a few more places where we forgot to rename 'main' to 'main-tabs'. In e18124898. --- src/nav/AppNavigator.js | 2 +- src/nav/__tests__/navSelectors-test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nav/AppNavigator.js b/src/nav/AppNavigator.js index 0d42b9c23a9..a85c37b7792 100644 --- a/src/nav/AppNavigator.js +++ b/src/nav/AppNavigator.js @@ -121,7 +121,7 @@ export default function AppNavigator(props: Props) { component={MainTabsScreen} options={{ // So we don't show a transition animation between 'loading' - // and 'main'. + // and 'main-tabs'. animationEnabled: false, }} /> diff --git a/src/nav/__tests__/navSelectors-test.js b/src/nav/__tests__/navSelectors-test.js index b83bda48b70..531bf242bd5 100644 --- a/src/nav/__tests__/navSelectors-test.js +++ b/src/nav/__tests__/navSelectors-test.js @@ -78,7 +78,7 @@ describe('getSameRoutesCount', () => { test('if last route differs from routes the count of same routes is 0', () => { NavigationService.getState = jest.fn().mockReturnValue( deepFreeze({ - routes: [{ name: 'main' }, { name: 'chat' }], + routes: [{ name: 'main-tabs' }, { name: 'chat' }], }), ); @@ -92,7 +92,7 @@ describe('getSameRoutesCount', () => { deepFreeze({ routes: [ { name: 'login' }, - { name: 'main' }, + { name: 'main-tabs' }, { name: 'chat', params: { key: 'value' } }, { name: 'chat', params: { key: 'another value' } }, { name: 'chat', params: { anotherKey: 'some value' } }, From 67b0cd70394f07f094998897839053949edabe5d Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Sat, 30 Jan 2021 15:15:35 -0500 Subject: [PATCH 03/10] fetchActions [nfc]: Address a TODO. Greg validates this as follows [1]: """ * The main-tabs route can only be the root; we never push it onto the stack, only reset to it or set it as initial. So the existing logic is equivalent to checking just whether the root route is main-tabs. * The possible roots of the nav stack are main-tabs, loading, account-pick, and realm-input. Those are the routes that we either reset to, or set as the initial route. * So we're talking about a possible change in behavior when the root route is account-pick or realm-input. * That case may indeed be possible -- either because of DEAD_QUEUE, or because of navigation between when the initial fetch starts and completes. * In particular if when the app starts up, or you've just switched accounts, you promptly go and hit "logout" before the initial fetch completes, I think that will trigger this case. * But if it does happen, it seems better to stick around in the flow you're already in, rather than yank over to the main-tabs screen. """ [1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4453.20.22Tried.20to.20use.20NavigationService.20before.20appContaine.2E.2E.2E/near/1111824 --- src/message/fetchActions.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/message/fetchActions.js b/src/message/fetchActions.js index f72ab5b0fbb..fd957a3fafe 100644 --- a/src/message/fetchActions.js +++ b/src/message/fetchActions.js @@ -172,16 +172,8 @@ const initialFetchCompletePlain = (): Action => ({ }); export const initialFetchComplete = () => async (dispatch: Dispatch, getState: GetState) => { - if (!getNavigationRoutes().some(navigationRoute => navigationRoute.name === 'main-tabs')) { - // If we're anywhere in the normal UI of the app, then remain - // where we are. Only reset the nav state if we're elsewhere, - // and in that case, go to the main screen. - // - // TODO: "elsewhere" is probably just a way of saying "on the - // loading screen", but we're not sure. We could adjust the - // conditional accordingly, if we found out we're not depending on - // the more general condition; see - // https://github.com/zulip/zulip-mobile/pull/4274#discussion_r505941875 + /* flowlint-next-line unnecessary-optional-chain:off */ // [0] may not exist + if (getNavigationRoutes()[0]?.name === 'loading') { NavigationService.dispatch(resetToMainTabs()); } dispatch(initialFetchCompletePlain()); From d63981f65ba65e3602a36aa8633e2df5acf6df3f Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 2 Feb 2021 13:36:02 -0500 Subject: [PATCH 04/10] MainTabsScreen: Go back to using `connect` instead of `useSelector`. And explain an annoying problem this solves. --- src/main/MainTabsScreen.js | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main/MainTabsScreen.js b/src/main/MainTabsScreen.js index 0c5a25b3c40..a44740b6dc7 100644 --- a/src/main/MainTabsScreen.js +++ b/src/main/MainTabsScreen.js @@ -8,6 +8,7 @@ import { import { useSafeAreaInsets } from 'react-native-safe-area-context'; import type { RouteProp, RouteParamsOf } from '../react-navigation'; +import type { Dispatch } from '../types'; import type { AppNavigationProp } from '../nav/AppNavigator'; import type { GlobalParamList } from '../nav/globalTypes'; import { bottomTabNavigatorConfig } from '../styles/tabs'; @@ -19,7 +20,7 @@ import { IconInbox, IconSettings, IconStream } from '../common/Icons'; import { OwnAvatar, OfflineNotice, ZulipStatusBar } from '../common'; import IconUnreadConversations from '../nav/IconUnreadConversations'; import ProfileScreen from '../account-info/ProfileScreen'; -import { useSelector } from '../react-redux'; +import { connect } from '../react-redux'; import { getHaveServerData } from '../selectors'; import styles, { ThemeContext } from '../styles'; @@ -41,14 +42,21 @@ const Tab = createBottomTabNavigator< MainTabsNavigationProp<>, >(); +type SelectorProps = $ReadOnly<{| + haveServerData: boolean, +|}>; + type Props = $ReadOnly<{| navigation: AppNavigationProp<'main-tabs'>, route: RouteProp<'main-tabs', void>, + + dispatch: Dispatch, + ...SelectorProps, |}>; -export default function MainTabsScreen(props: Props) { +function MainTabsScreen(props: Props) { const { backgroundColor } = useContext(ThemeContext); - const haveServerData = useSelector(getHaveServerData); + const { haveServerData } = props; const insets = useSafeAreaInsets(); @@ -119,3 +127,22 @@ export default function MainTabsScreen(props: Props) { ); } + +// `connect` does something useful for us that `useSelector` doesn't +// do: it interposes a new `ReactReduxContext.Provider` component, +// which proxies subscriptions so that the descendant components only +// rerender if this one continues to say their subtree should be kept +// around. See +// https://github.com/zulip/zulip-mobile/pull/4454#discussion_r578140524 +// and some discussion around +// https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/converting.20to.20Hooks/near/1111970 +// where we describe some limits of our understanding. +// +// We found these things out while investigating an annoying crash: we +// found that `mapStateToProps` on a descendant of `MainTabsScreen` +// was running -- and throwing an uncaught error -- on logout, and +// `MainTabsScreen`'s early return on `!haveServerData` wasn't +// preventing that from happening. +export default connect(state => ({ + haveServerData: getHaveServerData(state), +}))(MainTabsScreen); From 63d8b296dc8b8890f4d0b36ed06dc1b2a6868e71 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 2 Feb 2021 13:37:46 -0500 Subject: [PATCH 05/10] MainTabsScreen: Use `` instead of `null` in early return. This is a first step toward removing the 'loading' route, which will lead to some simplifications and a fix for an urgent bug. After this change, code that has been navigating to 'loading' can instead navigate to `MainTabsScreen`, and the user will still see the loading screen. See discussion [1]. [1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4453.20.22Tried.20to.20use.20NavigationService.20before.20appContaine.2E.2E.2E/near/1111875 --- src/main/MainTabsScreen.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/MainTabsScreen.js b/src/main/MainTabsScreen.js index a44740b6dc7..7d0d3af2442 100644 --- a/src/main/MainTabsScreen.js +++ b/src/main/MainTabsScreen.js @@ -23,6 +23,7 @@ import ProfileScreen from '../account-info/ProfileScreen'; import { connect } from '../react-redux'; import { getHaveServerData } from '../selectors'; import styles, { ThemeContext } from '../styles'; +import LoadingScreen from '../start/LoadingScreen'; export type MainTabsNavigatorParamList = {| home: RouteParamsOf, @@ -68,7 +69,7 @@ function MainTabsScreen(props: Props) { // // Avoid rendering any of our main UI in this case, to maintain // the guarantee that it can all rely on server data existing. - return null; + return ; } return ( From a023b75401c330ac7850b3fd202a5285801a8ef9 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 2 Feb 2021 13:44:23 -0500 Subject: [PATCH 06/10] nav: Navigate to 'main-tabs' instead of 'loading'. We've just made it safe to do this by having `MainTabsScreen` show the full-screen loading indicator if it doesn't have server data. Now, the time between LOGIN_SUCCESS/ACCOUNT_SWITCH and seeing the server data on MainTabsScreen is spent on MainTabsScreen itself, but in the branch that shows the loading indicator. Before, it was spent on LoadingScreen, which meant some confusing [1] logic about navigating to and from the 'loading' route. The 'loading' route ceases to be something we'd ever want or need to navigate to, and we'll remove it in an upcoming commit. [1] https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4453.20.22Tried.20to.20use.20NavigationService.20before.20appContaine.2E.2E.2E/near/1111808 --- src/account/accountActions.js | 6 +++--- src/main/MainTabsScreen.js | 12 ++++++------ src/nav/AppNavigator.js | 10 +--------- src/nav/getInitialRouteInfo.js | 17 +++++++---------- src/nav/navActions.js | 6 ------ 5 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/account/accountActions.js b/src/account/accountActions.js index e0647b4bad7..29501000c15 100644 --- a/src/account/accountActions.js +++ b/src/account/accountActions.js @@ -8,7 +8,7 @@ import { LOGIN_SUCCESS, LOGOUT, } from '../actionConstants'; -import { resetToAccountPicker, resetToLoading } from '../nav/navActions'; +import { resetToAccountPicker, resetToMainTabs } from '../nav/navActions'; import type { ZulipVersion } from '../utils/zulipVersion'; const accountSwitchPlain = (index: number): Action => ({ @@ -17,7 +17,7 @@ const accountSwitchPlain = (index: number): Action => ({ }); export const accountSwitch = (index: number) => (dispatch: Dispatch, getState: GetState) => { - NavigationService.dispatch(resetToLoading()); + NavigationService.dispatch(resetToMainTabs()); dispatch(accountSwitchPlain(index)); }; @@ -48,7 +48,7 @@ export const loginSuccess = (realm: URL, email: string, apiKey: string) => ( dispatch: Dispatch, getState: GetState, ) => { - NavigationService.dispatch(resetToLoading()); + NavigationService.dispatch(resetToMainTabs()); dispatch(loginSuccessPlain(realm, email, apiKey)); }; diff --git a/src/main/MainTabsScreen.js b/src/main/MainTabsScreen.js index 7d0d3af2442..6c76a901fdf 100644 --- a/src/main/MainTabsScreen.js +++ b/src/main/MainTabsScreen.js @@ -62,13 +62,13 @@ function MainTabsScreen(props: Props) { const insets = useSafeAreaInsets(); if (!haveServerData) { - // This can happen if the user has just logged out; this screen - // is still visible for the duration of the nav transition, and - // it's legitimate for its `render` to get called again. - // See our #4275. + // Show a full-screen loading indicator while waiting for the + // initial fetch to complete, if we don't have potentially stale + // data to show instead. Also show it for the duration of the nav + // transition just after the user logs out (see our #4275). // - // Avoid rendering any of our main UI in this case, to maintain - // the guarantee that it can all rely on server data existing. + // And avoid rendering any of our main UI, to maintain the + // guarantee that it can all rely on server data existing. return ; } diff --git a/src/nav/AppNavigator.js b/src/nav/AppNavigator.js index a85c37b7792..d7de2250b93 100644 --- a/src/nav/AppNavigator.js +++ b/src/nav/AppNavigator.js @@ -116,15 +116,7 @@ export default function AppNavigator(props: Props) { - + { - const { hasAuth, accounts, haveServerData } = args; + const { hasAuth, accounts } = args; // If the active account is not logged in, bring the user as close // as we can to AuthScreen, the place where they can log in. @@ -39,14 +39,11 @@ export default (args: {| } } - // If there's an active, logged-in account but no server data, then behave - // like `ACCOUNT_SWITCH`: show loading screen. Crucially, `sessionReducer` - // will have set `needsInitialFetch`, too, so we really will be loading. - if (!haveServerData) { - return { initialRouteName: 'loading' }; - } - - // Great: we have an active, logged-in account, and server data for it. - // Show the main UI. + // Show the main UI screen. + // + // If we don't have server data yet, that screen will show a loading + // indicator until the data is loaded. Crucially, `sessionReducer` + // will have set `needsInitialFetch`, too, so we really will be + // loading. return { initialRouteName: 'main-tabs' }; }; diff --git a/src/nav/navActions.js b/src/nav/navActions.js index a7f6157e9a5..789a15946cb 100644 --- a/src/nav/navActions.js +++ b/src/nav/navActions.js @@ -15,12 +15,6 @@ export const navigateBack = (): GenericNavigationAction => StackActions.pop(getS * "Reset" actions, to explicitly prohibit back navigation. */ -export const resetToLoading = (): GenericNavigationAction => - CommonActions.reset({ - index: 0, - routes: [{ name: 'loading' }], - }); - export const resetToAccountPicker = (): GenericNavigationAction => CommonActions.reset({ index: 0, routes: [{ name: 'account-pick' }] }); From a8c2375e5fa897b4c551ef1999352bc08895cfba Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 2 Feb 2021 14:13:21 -0500 Subject: [PATCH 07/10] getInitialRouteInfo [nfc]: Stop taking `haveServerData`. The need for this was removed in a recent commit. --- src/nav/AppNavigator.js | 4 +--- src/nav/getInitialRouteInfo.js | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/nav/AppNavigator.js b/src/nav/AppNavigator.js index d7de2250b93..b609c2a858a 100644 --- a/src/nav/AppNavigator.js +++ b/src/nav/AppNavigator.js @@ -9,7 +9,7 @@ import { import type { RouteParamsOf } from '../react-navigation'; import { useSelector } from '../react-redux'; -import { hasAuth as getHasAuth, getAccounts, getHaveServerData } from '../selectors'; +import { hasAuth as getHasAuth, getAccounts } from '../selectors'; import getInitialRouteInfo from './getInitialRouteInfo'; import type { GlobalParamList } from './globalTypes'; import AccountPickScreen from '../account/AccountPickScreen'; @@ -89,12 +89,10 @@ type Props = $ReadOnly<{||}>; export default function AppNavigator(props: Props) { const hasAuth = useSelector(getHasAuth); const accounts = useSelector(getAccounts); - const haveServerData = useSelector(getHaveServerData); const { initialRouteName, initialRouteParams } = getInitialRouteInfo({ hasAuth, accounts, - haveServerData, }); return ( diff --git a/src/nav/getInitialRouteInfo.js b/src/nav/getInitialRouteInfo.js index 7a0c426c139..8cf3597d41b 100644 --- a/src/nav/getInitialRouteInfo.js +++ b/src/nav/getInitialRouteInfo.js @@ -7,7 +7,6 @@ import type { Account } from '../types'; export default (args: {| hasAuth: boolean, accounts: Account[], - haveServerData: boolean, |}): {| initialRouteName: string, initialRouteParams?: ScreenParams |} => { const { hasAuth, accounts } = args; From ec6cb5afe77a26885d83a843696e1c05dcba497e Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 2 Feb 2021 13:56:32 -0500 Subject: [PATCH 08/10] fetchActions: Remove a now-unnecessary navigation. This is fine because we've just changed all the places where we were navigating to 'loading', to instead navigate to 'main-tabs'. This removes a `NavigationService` callsite that's been throwing quite a lot; that's #4453. We still don't know why it's throwing those errors, and we haven't managed to reproduce them yet. But it means we should continue to prioritize removing `NavigationService`. See discussion at https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4453.20.22Tried.20to.20use.20NavigationService.20before.20appContaine.2E.2E.2E/near/1111875. Fixes: #4453 --- src/message/fetchActions.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/message/fetchActions.js b/src/message/fetchActions.js index fd957a3fafe..9232a2b1fdf 100644 --- a/src/message/fetchActions.js +++ b/src/message/fetchActions.js @@ -1,10 +1,8 @@ /* @flow strict-local */ -import * as NavigationService from '../nav/NavigationService'; import type { Narrow, Dispatch, GetState, GlobalState, Message, Action, UserId } from '../types'; import type { ApiResponseServerSettings } from '../api/settings/getServerSettings'; import type { InitialData } from '../api/initialDataTypes'; import * as api from '../api'; -import { resetToMainTabs } from '../actions'; import { isClientError } from '../api/apiErrors'; import { getAuth, @@ -13,7 +11,6 @@ import { getLastMessageId, getCaughtUpForNarrow, getFetchingForNarrow, - getNavigationRoutes, } from '../selectors'; import config from '../config'; import { @@ -172,10 +169,6 @@ const initialFetchCompletePlain = (): Action => ({ }); export const initialFetchComplete = () => async (dispatch: Dispatch, getState: GetState) => { - /* flowlint-next-line unnecessary-optional-chain:off */ // [0] may not exist - if (getNavigationRoutes()[0]?.name === 'loading') { - NavigationService.dispatch(resetToMainTabs()); - } dispatch(initialFetchCompletePlain()); }; From 4cd72a42a682ff2f833a9d18aaefd9f96cc89468 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 2 Feb 2021 14:54:14 -0500 Subject: [PATCH 09/10] fetchActions [nfc]: Make `messageFetchComplete` a plain action again. It was previously a thunk action in order to ensure that a navigation action wouldn't be executed until after the store had rehydrated. But we've just stopped doing that navigation. --- src/message/fetchActions.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/message/fetchActions.js b/src/message/fetchActions.js index 9232a2b1fdf..a3c0d97eb7b 100644 --- a/src/message/fetchActions.js +++ b/src/message/fetchActions.js @@ -164,14 +164,10 @@ const initialFetchStart = (): Action => ({ type: INITIAL_FETCH_START, }); -const initialFetchCompletePlain = (): Action => ({ +const initialFetchComplete = (): Action => ({ type: INITIAL_FETCH_COMPLETE, }); -export const initialFetchComplete = () => async (dispatch: Dispatch, getState: GetState) => { - dispatch(initialFetchCompletePlain()); -}; - /** Private; exported only for tests. */ export const isFetchNeededAtAnchor = ( state: GlobalState, From 350ebcdb55ce97986dd69886515ae30640e4851b Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 2 Feb 2021 14:06:51 -0500 Subject: [PATCH 10/10] LoadingScreen [nfc]: Stop using as a navigation route, rename. We recently stopped navigating to the 'loading' route at all, which means we can stop listing it in `AppNavigator`. When we do so, `LoadingScreen` loses all its former claims to a special status as a React Navigation screen component. So, remove `route` and `navigation` altogether from its props, rename the component, and put it in src/common along with our other loading-indicator components. --- src/ZulipMobile.js | 4 ++-- .../FullScreenLoading.js} | 19 ++++++------------- src/main/MainTabsScreen.js | 4 ++-- src/nav/AppNavigator.js | 3 --- 4 files changed, 10 insertions(+), 20 deletions(-) rename src/{start/LoadingScreen.js => common/FullScreenLoading.js} (53%) diff --git a/src/ZulipMobile.js b/src/ZulipMobile.js index a1f9e496877..911418473b5 100644 --- a/src/ZulipMobile.js +++ b/src/ZulipMobile.js @@ -15,7 +15,7 @@ import AppEventHandlers from './boot/AppEventHandlers'; import AppDataFetcher from './boot/AppDataFetcher'; import BackNavigationHandler from './nav/BackNavigationHandler'; import { initializeSentry } from './sentry'; -import LoadingScreen from './start/LoadingScreen'; +import FullScreenLoading from './common/FullScreenLoading'; initializeSentry(); @@ -44,7 +44,7 @@ export default (): React$Node => ( backgroundColor: BRAND_COLOR, }} > - + diff --git a/src/start/LoadingScreen.js b/src/common/FullScreenLoading.js similarity index 53% rename from src/start/LoadingScreen.js rename to src/common/FullScreenLoading.js index a9014e785d2..4ae63bc83bd 100644 --- a/src/start/LoadingScreen.js +++ b/src/common/FullScreenLoading.js @@ -3,10 +3,8 @@ import React from 'react'; import { View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import type { RouteProp } from '../react-navigation'; -import type { AppNavigationProp } from '../nav/AppNavigator'; import { BRAND_COLOR, createStyleSheet } from '../styles'; -import { LoadingIndicator, ZulipStatusBar } from '../common'; +import { LoadingIndicator, ZulipStatusBar } from '.'; const componentStyles = createStyleSheet({ center: { @@ -17,17 +15,12 @@ const componentStyles = createStyleSheet({ }, }); -type Props = $ReadOnly<{| - // Since we've put this screen in AppNavigator's route config, but - // we do invoke it from one other place, which is not a navigator - // (see ZulipMobile.js), it might or might not get the `navigation` - // prop (with the particular shape for this route) and the `route` - // prop for free. - navigation?: AppNavigationProp<'loading'>, - route?: RouteProp<'loading', void>, -|}>; +type Props = $ReadOnly<{||}>; -export default function LoadingScreen(props: Props) { +/** + * Meant to be used to cover the whole screen. + */ +export default function FullScreenLoading(props: Props) { const insets = useSafeAreaInsets(); return ( diff --git a/src/main/MainTabsScreen.js b/src/main/MainTabsScreen.js index 6c76a901fdf..2e1c1f6938f 100644 --- a/src/main/MainTabsScreen.js +++ b/src/main/MainTabsScreen.js @@ -23,7 +23,7 @@ import ProfileScreen from '../account-info/ProfileScreen'; import { connect } from '../react-redux'; import { getHaveServerData } from '../selectors'; import styles, { ThemeContext } from '../styles'; -import LoadingScreen from '../start/LoadingScreen'; +import FullScreenLoading from '../common/FullScreenLoading'; export type MainTabsNavigatorParamList = {| home: RouteParamsOf, @@ -69,7 +69,7 @@ function MainTabsScreen(props: Props) { // // And avoid rendering any of our main UI, to maintain the // guarantee that it can all rely on server data existing. - return ; + return ; } return ( diff --git a/src/nav/AppNavigator.js b/src/nav/AppNavigator.js index b609c2a858a..50f0f311ccf 100644 --- a/src/nav/AppNavigator.js +++ b/src/nav/AppNavigator.js @@ -23,7 +23,6 @@ import GroupDetailsScreen from '../chat/GroupDetailsScreen'; import SearchMessagesScreen from '../search/SearchMessagesScreen'; import UsersScreen from '../users/UsersScreen'; import ChatScreen from '../chat/ChatScreen'; -import LoadingScreen from '../start/LoadingScreen'; import LanguageScreen from '../settings/LanguageScreen'; import PasswordAuthScreen from '../start/PasswordAuthScreen'; import DebugScreen from '../settings/DebugScreen'; @@ -52,7 +51,6 @@ export type AppNavigatorParamList = {| chat: RouteParamsOf, 'dev-auth': RouteParamsOf, 'emoji-picker': RouteParamsOf, - loading: RouteParamsOf, 'main-tabs': RouteParamsOf, 'message-reactions': RouteParamsOf, 'password-auth': RouteParamsOf, @@ -113,7 +111,6 @@ export default function AppNavigator(props: Props) { -