Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🍒 Cherry pick PR #20654 to staging 🍒 #20729

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001032705
versionName "1.3.27-5"
versionCode 1001032706
versionName "1.3.27-6"
}

splits {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.27.5</string>
<string>1.3.27.6</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.27.5</string>
<string>1.3.27.6</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.27-5",
"version": "1.3.27-6",
"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.",
Expand Down
14 changes: 14 additions & 0 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import KeyboardShortcut from '../../KeyboardShortcut';
import Navigation from '../Navigation';
import * as User from '../../actions/User';
import * as Modal from '../../actions/Modal';
import * as Report from '../../actions/Report';
import modalCardStyleInterpolator from './modalCardStyleInterpolator';
import createResponsiveStackNavigator from './createResponsiveStackNavigator';
import SCREENS from '../../../SCREENS';
Expand Down Expand Up @@ -85,13 +86,18 @@ const propTypes = {
session: PropTypes.shape({
email: PropTypes.string.isRequired,
}),

/** The report ID of the last opened public room as anonymous user */
lastOpenedPublicRoomID: PropTypes.string,

...windowDimensionsPropTypes,
};

const defaultProps = {
session: {
email: null,
},
lastOpenedPublicRoomID: null,
};

class AuthScreens extends React.Component {
Expand All @@ -115,6 +121,11 @@ class AuthScreens extends React.Component {

App.openApp();
App.setUpPoliciesAndNavigate(this.props.session);

if (this.props.lastOpenedPublicRoomID) {
// Re-open the last opened public room if the user logged in from a public room link
Report.openLastOpenedPublicRoom(this.props.lastOpenedPublicRoomID);
}
Download.clearDownloads();
Timing.end(CONST.TIMING.HOMEPAGE_INITIAL_RENDER);

Expand Down Expand Up @@ -274,5 +285,8 @@ export default compose(
session: {
key: ONYXKEYS.SESSION,
},
lastOpenedPublicRoomID: {
key: ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID,
},
}),
)(AuthScreens);
18 changes: 0 additions & 18 deletions src/libs/Navigation/AppNavigator/ReportScreenWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import reportPropTypes from '../../../pages/reportPropTypes';
import FullScreenLoadingIndicator from '../../../components/FullscreenLoadingIndicator';
import {withNavigationPropTypes} from '../../../components/withNavigation';
import * as App from '../../actions/App';
import * as Report from '../../actions/Report';
import * as Session from '../../actions/Session';

const propTypes = {
/** Available reports that would be displayed in this navigator */
Expand All @@ -33,9 +31,6 @@ const propTypes = {
}),
),

/** The report ID of the last opened public room as anonymous user */
lastOpenedPublicRoomID: PropTypes.string,

isFirstTimeNewExpensifyUser: PropTypes.bool,

/** Navigation route context info provided by react navigation */
Expand All @@ -58,7 +53,6 @@ const defaultProps = {
betas: [],
policies: {},
isFirstTimeNewExpensifyUser: false,
lastOpenedPublicRoomID: null,
};

/**
Expand Down Expand Up @@ -102,15 +96,6 @@ class ReportScreenWrapper extends Component {
}
}

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) {
// Don't update if there is a reportID in the params already
if (lodashGet(this.props.route, 'params.reportID', null)) {
Expand Down Expand Up @@ -161,7 +146,4 @@ export default withOnyx({
isFirstTimeNewExpensifyUser: {
key: ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER,
},
lastOpenedPublicRoomID: {
key: ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID,
},
})(ReportScreenWrapper);
13 changes: 13 additions & 0 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,18 @@ function setLastOpenedPublicRoom(reportID) {
Onyx.set(ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID, reportID);
}

/**
* Navigates to the last opened public room
*
* @param {String} lastOpenedPublicRoomID
*/
function openLastOpenedPublicRoom(lastOpenedPublicRoomID) {
Navigation.isNavigationReady().then(() => {
setLastOpenedPublicRoom('');
Navigation.navigate(ROUTES.getReportRoute(lastOpenedPublicRoomID));
});
}

/**
* Flag a comment as offensive
*
Expand Down Expand Up @@ -1804,4 +1816,5 @@ export {
leaveRoom,
setLastOpenedPublicRoom,
flagComment,
openLastOpenedPublicRoom,
};