diff --git a/android/app/build.gradle b/android/app/build.gradle index cc8ff24040134..ddd1d96877bf7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -106,8 +106,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001032004 - versionName "1.3.20-4" + versionCode 1001032005 + versionName "1.3.20-5" } splits { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 7799ee211bb93..5435f66b9b845 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.3.20.4 + 1.3.20.5 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 3d0811c1ba375..572e3a408cc34 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.3.20.4 + 1.3.20.5 diff --git a/package-lock.json b/package-lock.json index 53da8adc9b32a..9865e6f387c2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.3.20-4", + "version": "1.3.20-5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.3.20-4", + "version": "1.3.20-5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 54ef851b4bdc2..856fc01cef69f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.3.20-4", + "version": "1.3.20-5", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", diff --git a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js index 0fb315bffc7b8..78becd360621f 100644 --- a/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js +++ b/src/libs/Navigation/AppNavigator/MainDrawerNavigator.js @@ -10,6 +10,8 @@ import Permissions from '../../Permissions'; import Timing from '../../actions/Timing'; import CONST from '../../../CONST'; import * as App from '../../actions/App'; +import * as Report from '../../actions/Report'; +import * as Session from '../../actions/Session'; // Screens import ReportScreen from '../../../pages/home/ReportScreen'; @@ -38,6 +40,9 @@ const propTypes = { }), ), + /** The report ID of the last opened public room as anonymous user */ + lastOpenedPublicRoomID: PropTypes.string, + isFirstTimeNewExpensifyUser: PropTypes.bool, route: PropTypes.shape({ @@ -54,6 +59,7 @@ const defaultProps = { betas: [], policies: {}, isFirstTimeNewExpensifyUser: false, + lastOpenedPublicRoomID: null, }; /** @@ -91,6 +97,15 @@ class MainDrawerNavigator extends Component { this.isFromCache = _.size(props.reports) > 0; } + componentDidMount() { + if (!this.props.lastOpenedPublicRoomID || Session.isAnonymousUser()) { + return; + } + // Re-open the last opened public room if the user logged in + Report.setLastOpenedPublicRoom(''); + Report.openReport(this.props.lastOpenedPublicRoomID); + } + shouldComponentUpdate(nextProps) { const initialNextParams = getInitialReportScreenParams( nextProps.reports, @@ -172,4 +187,7 @@ export default withOnyx({ isFirstTimeNewExpensifyUser: { key: ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER, }, + lastOpenedPublicRoomID: { + key: ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, + }, })(MainDrawerNavigator); diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index df114df307f49..7d9c363273ef2 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -40,7 +40,6 @@ import * as EmojiPickerAction from '../../libs/actions/EmojiPickerAction'; import TaskHeader from '../../components/TaskHeader'; import MoneyRequestHeader from '../../components/MoneyRequestHeader'; import * as ComposerActions from '../../libs/actions/Composer'; -import * as Session from '../../libs/actions/Session'; const propTypes = { /** Navigation route context info provided by react navigation */ @@ -84,9 +83,6 @@ const propTypes = { /** The account manager report ID */ accountManagerReportID: PropTypes.string, - /** The report ID of the last opened public room as anonymous user */ - lastOpenedPublicRoomID: PropTypes.string, - /** All of the personal details for everyone */ personalDetails: PropTypes.objectOf(personalDetailsPropType), @@ -107,7 +103,6 @@ const defaultProps = { policies: {}, accountManagerReportID: null, personalDetails: {}, - lastOpenedPublicRoomID: null, }; /** @@ -198,13 +193,6 @@ class ReportScreen extends React.Component { } fetchReportIfNeeded() { - // Re-open the last opened public room if the user logged in - if (this.props.lastOpenedPublicRoomID && !Session.isAnonymousUser()) { - Report.setLastOpenedPublicRoom(''); - Report.openReport(this.props.lastOpenedPublicRoomID); - return; - } - const reportIDFromPath = getReportID(this.props.route); // Report ID will be empty when the reports collection is empty. @@ -400,9 +388,6 @@ export default compose( withDrawerState, withNetwork(), withOnyx({ - lastOpenedPublicRoomID: { - key: ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, - }, isSidebarLoaded: { key: ONYXKEYS.IS_SIDEBAR_LOADED, },