Skip to content

Commit

Permalink
fix: [#176778241] On bug report can't share the screenshot (#2772)
Browse files Browse the repository at this point in the history
* [#176778241] fix

* [#176778241] add comment

Co-authored-by: Cristiano Tofani <[email protected]>
  • Loading branch information
Undermaken and CrisTofani authored Feb 4, 2021
1 parent 94ed6a7 commit 4b6611f
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions ts/components/screens/BaseScreenComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
DefaultReportAttachmentTypeConfiguration,
setInstabugSupportTokenAttribute,
TypeLogs,
instabugLog
instabugLog,
defaultAttachmentTypeConfiguration
} from "../../boot/configureInstabug";
import I18n from "../../i18n";
import customVariables from "../../theme/variables";
Expand Down Expand Up @@ -170,18 +171,10 @@ class BaseScreenComponent extends React.PureComponent<Props, State> {
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) {
Expand Down

0 comments on commit 4b6611f

Please sign in to comment.