Skip to content

Commit 1c6d407

Browse files
committed
fix: Chat-In offline, uploading attachment & deleting it, is not showing strike-through.
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
1 parent e9fb49d commit 1c6d407

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/pages/home/report/ReportActionItemFragment.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function ReportActionItemFragment({
105105
source={source}
106106
html={fragment.html ?? ''}
107107
addExtraMargin={!displayAsGroup}
108+
styleAsDeleted={!!(isOffline && isPendingDelete)}
108109
/>
109110
);
110111
}

src/pages/home/report/comment/AttachmentCommentFragment.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
import React from 'react';
22
import {View} from 'react-native';
33
import useThemeStyles from '@hooks/useThemeStyles';
4+
import CONST from '@src/CONST';
45
import type {OriginalMessageSource} from '@src/types/onyx/OriginalMessage';
56
import RenderCommentHTML from './RenderCommentHTML';
67

78
type AttachmentCommentFragmentProps = {
89
source: OriginalMessageSource;
910
html: string;
1011
addExtraMargin: boolean;
12+
styleAsDeleted: boolean;
1113
};
1214

13-
function AttachmentCommentFragment({addExtraMargin, html, source}: AttachmentCommentFragmentProps) {
15+
function AttachmentCommentFragment({addExtraMargin, html, source, styleAsDeleted}: AttachmentCommentFragmentProps) {
1416
const styles = useThemeStyles();
17+
const isUploading = html === CONST.ATTACHMENT_UPLOADING_MESSAGE_HTML;
18+
const htmlContent = styleAsDeleted && isUploading ? `<del>${html}</del>` : html;
19+
1520
return (
1621
<View style={addExtraMargin ? styles.mt2 : {}}>
1722
<RenderCommentHTML
1823
source={source}
19-
html={html}
24+
html={htmlContent}
2025
/>
2126
</View>
2227
);

0 commit comments

Comments
 (0)