Skip to content

Commit

Permalink
fix: Chat-In offline, uploading attachment & deleting it, is not show…
Browse files Browse the repository at this point in the history
…ing strike-through.

Signed-off-by: Krishna Gupta <[email protected]>
  • Loading branch information
Krishna2323 committed Feb 25, 2024
1 parent e9fb49d commit 1c6d407
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 1c6d407

Please sign in to comment.