From 99409d1af41bf4635d4543d1540b263f62e7ef1a Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 3 May 2022 11:48:02 -0400 Subject: [PATCH] chore: evaluate `NewServerView` (#4101) --- app/views/NewServerView/index.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/NewServerView/index.tsx b/app/views/NewServerView/index.tsx index 67d7f6b68..9ab2fa78d 100644 --- a/app/views/NewServerView/index.tsx +++ b/app/views/NewServerView/index.tsx @@ -14,7 +14,7 @@ import Button from '../../containers/Button'; import FormContainer, { FormContainerInner } from '../../containers/FormContainer'; import * as HeaderButton from '../../containers/HeaderButton'; import OrSeparator from '../../containers/OrSeparator'; -import { IBaseScreen, TServerHistoryModel } from '../../definitions'; +import { IApplicationState, IBaseScreen, TServerHistoryModel } from '../../definitions'; import { withDimensions } from '../../dimensions'; import I18n from '../../i18n'; import database from '../../lib/database'; @@ -67,7 +67,7 @@ const styles = StyleSheet.create({ interface INewServerViewProps extends IBaseScreen { connecting: boolean; - previousServer: string; + previousServer: string | null; width: number; height: number; } @@ -75,7 +75,7 @@ interface INewServerViewProps extends IBaseScreen { const { dispatch, previousServer } = this.props; dispatch(inviteLinksClear()); - dispatch(selectServerRequest(previousServer)); + if (previousServer) { + dispatch(selectServerRequest(previousServer)); + } }; handleNewServerEvent = (event: { server: string }) => { @@ -265,8 +267,7 @@ class NewServerView extends React.Component this.setState({ certificate: null }) // We not need delete file from DocumentPicker because it is a temp file }); }; @@ -405,7 +406,7 @@ class NewServerView extends React.Component ({ +const mapStateToProps = (state: IApplicationState) => ({ connecting: state.server.connecting, previousServer: state.server.previousServer });