From 4b6611f0ce3bd9fbc93b3aaca617d3cc3aa411cb Mon Sep 17 00:00:00 2001 From: Matteo Boschi Date: Thu, 4 Feb 2021 16:09:04 +0100 Subject: [PATCH] fix: [#176778241] On bug report can't share the screenshot (#2772) * [#176778241] fix * [#176778241] add comment Co-authored-by: Cristiano Tofani --- ts/components/screens/BaseScreenComponent.tsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/ts/components/screens/BaseScreenComponent.tsx b/ts/components/screens/BaseScreenComponent.tsx index 49d904f0597..46a7a117ae5 100644 --- a/ts/components/screens/BaseScreenComponent.tsx +++ b/ts/components/screens/BaseScreenComponent.tsx @@ -19,7 +19,8 @@ import { DefaultReportAttachmentTypeConfiguration, setInstabugSupportTokenAttribute, TypeLogs, - instabugLog + instabugLog, + defaultAttachmentTypeConfiguration } from "../../boot/configureInstabug"; import I18n from "../../i18n"; import customVariables from "../../theme/variables"; @@ -170,18 +171,10 @@ class BaseScreenComponent extends React.PureComponent { const { reportAttachmentTypes } = this.props; const { shouldAttachScreenshotToIBRequest } = this.state; - // Do not ignore reportAttachmentTypes, but overwrite - // the screenshot variable if the form featured the checkbox - const attachmentConfig = { - screenshot: - shouldAttachScreenshotToIBRequest !== undefined - ? shouldAttachScreenshotToIBRequest - : Boolean(reportAttachmentTypes?.screenshot), - ...(reportAttachmentTypes || { - extraScreenshot: false, - galleryImage: false, - screenRecording: false - }) + // if reportAttachmentTypes is undefined use the default attachment config + const attachmentConfig: DefaultReportAttachmentTypeConfiguration = { + ...(reportAttachmentTypes ?? defaultAttachmentTypeConfiguration), + screenshot: shouldAttachScreenshotToIBRequest ?? true }; switch (type) {