Skip to content

Commit

Permalink
Merge pull request #37179 from Krishna2323/krishna2323/issue/36639
Browse files Browse the repository at this point in the history
fix: Chat-In offline, uploading attachment & deleting it, is not showing strike-through
  • Loading branch information
Beamanator authored Feb 27, 2024
2 parents 776a8bb + 1c6d407 commit 668df99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItemFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function ReportActionItemFragment({
source={source}
html={fragment.html ?? ''}
addExtraMargin={!displayAsGroup}
styleAsDeleted={!!(isOffline && isPendingDelete)}
/>
);
}
Expand Down
9 changes: 7 additions & 2 deletions src/pages/home/report/comment/AttachmentCommentFragment.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import React from 'react';
import {View} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
import type {OriginalMessageSource} from '@src/types/onyx/OriginalMessage';
import RenderCommentHTML from './RenderCommentHTML';

type AttachmentCommentFragmentProps = {
source: OriginalMessageSource;
html: string;
addExtraMargin: boolean;
styleAsDeleted: boolean;
};

function AttachmentCommentFragment({addExtraMargin, html, source}: AttachmentCommentFragmentProps) {
function AttachmentCommentFragment({addExtraMargin, html, source, styleAsDeleted}: AttachmentCommentFragmentProps) {
const styles = useThemeStyles();
const isUploading = html === CONST.ATTACHMENT_UPLOADING_MESSAGE_HTML;
const htmlContent = styleAsDeleted && isUploading ? `<del>${html}</del>` : html;

return (
<View style={addExtraMargin ? styles.mt2 : {}}>
<RenderCommentHTML
source={source}
html={html}
html={htmlContent}
/>
</View>
);
Expand Down

0 comments on commit 668df99

Please sign in to comment.