Skip to content

Commit

Permalink
fixed error with sorting values, fixing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
JediWattson committed Dec 4, 2022
1 parent 480e550 commit 70c9ac3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/AttachmentCarousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ class AttachmentCarousel extends React.Component {
*/
makeStateWithReports() {
let page;
const actionsArr = ReportActionsUtils.getSortedReportActions(this.props.reportActions);
const attachments = _.reduce(actionsArr, (attachmentsAccumulator, {action: reportAction}) => {
if (reportAction.originalMessage && reportAction.originalMessage.html) {
const matchesIt = reportAction.originalMessage.html.matchAll(CONST.REGEX.ATTACHMENT_DATA);
const actionsArr = ReportActionsUtils.getSortedReportActions(_.values(this.props.reportActions), true);
const attachments = _.reduce(actionsArr, (attachmentsAccumulator, {originalMessage}) => {
if (originalMessage && originalMessage.html) {
const matchesIt = originalMessage.html.matchAll(CONST.REGEX.ATTACHMENT_DATA);
const matches = [...matchesIt];
if (matches.length === 2) {
const [src, name] = matches;
Expand Down Expand Up @@ -169,7 +169,7 @@ class AttachmentCarousel extends React.Component {
style={[styles.leftAttachmentArrow]}
icon={Expensicons.BackArrow}
iconFill={themeColors.text}
iconStyles={[styles.mr0, {PointerEvent: 'auto'}]}
iconStyles={[styles.mr0]}
onPress={() => this.cycleThroughAttachments(1)}
isDisabled={this.state.isBackDisabled}
/>
Expand All @@ -178,7 +178,7 @@ class AttachmentCarousel extends React.Component {
style={[styles.rightAttachmentArrow]}
icon={Expensicons.ArrowRight}
iconFill={themeColors.text}
iconStyles={[styles.mr0, {PointerEvent: 'auto'}]}
iconStyles={[styles.mr0]}
onPress={() => this.cycleThroughAttachments(-1)}
isDisabled={this.state.isForwardDisabled}
/>
Expand Down
5 changes: 5 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2108,10 +2108,15 @@ const styles = {
attachmentModalArrowsContainer: {
display: 'flex',
justifyContent: 'center',
cursor: 'unset',
height: '100%',
width: '100%',
},

attachmentContainer: {
height: '100%',
},

leftAttachmentArrow: {
zIndex: 23,
position: 'absolute',
Expand Down

0 comments on commit 70c9ac3

Please sign in to comment.