We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a0755c commit 4df91a2Copy full SHA for 4df91a2
src/components/Attachments/AttachmentCarousel/CarouselItem.js
@@ -47,10 +47,8 @@ const defaultProps = {
47
function CarouselItem({item, isFocused, onPress}) {
48
const {translate} = useLocalize();
49
const {isAttachmentHidden} = useContext(ReportAttachmentsContext);
50
- const [isHidden, setIsHidden] = useState(() => {
51
- const isAttachmentHiddenValue = isAttachmentHidden(item.reportActionID);
52
- return isAttachmentHiddenValue === undefined ? item.hasBeenFlagged : isAttachmentHiddenValue;
53
- });
+ // eslint-disable-next-line es/no-nullish-coalescing-operators
+ const [isHidden, setIsHidden] = useState(isAttachmentHidden(item.reportActionID) ?? item.hasBeenFlagged);
54
55
const renderButton = (style) => (
56
<Button
0 commit comments