Skip to content

Commit

Permalink
Merge pull request #18920 from Expensify/OSBotify-cherry-pick-staging…
Browse files Browse the repository at this point in the history
…-18897

🍒 Cherry pick PR #18897 to staging 🍒
  • Loading branch information
OSBotify authored May 14, 2023
2 parents cfd4858 + dab66fb commit 9fb9875
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
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 1001031304
versionName "1.3.13-4"
versionCode 1001031305
versionName "1.3.13-5"
}

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 @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.13.4</string>
<string>1.3.13.5</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.13.4</string>
<string>1.3.13.5</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.13-4",
"version": "1.3.13-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.",
Expand Down
9 changes: 8 additions & 1 deletion src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const propTypes = {
/** Optional callback to fire when we want to preview an image and approve it for use. */
onConfirm: PropTypes.func,

/** Optional callback to fire when we want to do something after modal show. */
onModalShow: PropTypes.func,

/** Optional callback to fire when we want to do something after modal hide. */
onModalHide: PropTypes.func,

Expand Down Expand Up @@ -69,6 +72,7 @@ const defaultProps = {
allowDownload: false,
headerTitle: null,
reportID: '',
onModalShow: () => {},
onModalHide: () => {},
};

Expand Down Expand Up @@ -255,7 +259,10 @@ class AttachmentModal extends PureComponent {
onClose={() => this.setState({isModalOpen: false})}
isVisible={this.state.isModalOpen}
backgroundColor={themeColors.componentBG}
onModalShow={() => this.setState({shouldLoadAttachment: true})}
onModalShow={() => {
this.props.onModalShow();
this.setState({shouldLoadAttachment: true})
}}
onModalHide={(e) => {
this.props.onModalHide(e);
this.setState({shouldLoadAttachment: false});
Expand Down
17 changes: 6 additions & 11 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ class ReportActionCompose extends React.Component {
this.showPopoverMenu = this.showPopoverMenu.bind(this);
this.comment = props.comment;
this.setShouldBlockEmojiCalcToFalse = this.setShouldBlockEmojiCalcToFalse.bind(this);
this.attachmentPreviewClosed = this.attachmentPreviewClosed.bind(this);

// React Native will retain focus on an input for native devices but web/mWeb behave differently so we have some focus management
// code that will refocus the compose input after a user closes a modal or some other actions, see usage of ReportActionComposeFocusManager
Expand Down Expand Up @@ -855,14 +854,6 @@ class ReportActionCompose extends React.Component {
return true;
}

/**
* Event handler to update the state after the attachment preview is closed.
*/
attachmentPreviewClosed() {
this.setShouldBlockEmojiCalcToFalse();
this.setState({isAttachmentPreviewActive: false});
}

render() {
const reportParticipants = _.without(lodashGet(this.props.report, 'participants', []), this.props.currentUserPersonalDetails.login);
const participantsWithoutExpensifyEmails = _.difference(reportParticipants, CONST.EXPENSIFY_EMAILS);
Expand Down Expand Up @@ -902,7 +893,11 @@ class ReportActionCompose extends React.Component {
<AttachmentModal
headerTitle={this.props.translate('reportActionCompose.sendAttachment')}
onConfirm={this.addAttachment}
onModalHide={this.attachmentPreviewClosed}
onModalShow={() => this.setState({isAttachmentPreviewActive: true})}
onModalHide={() => {
this.setShouldBlockEmojiCalcToFalse();
this.setState({isAttachmentPreviewActive: false});
}}
>
{({displayFileInModal}) => (
<>
Expand Down Expand Up @@ -1017,7 +1012,7 @@ class ReportActionCompose extends React.Component {

displayFileInModal(file);

this.setState({isAttachmentPreviewActive: true, isDraggingOver: false});
this.setState({isDraggingOver: false});
}}
disabled={this.props.disabled}
>
Expand Down

0 comments on commit 9fb9875

Please sign in to comment.