Skip to content

Commit 7c0d2c0

Browse files
authored
Fix/destructuring not working (#51)
* 🐛 fix destructuring the submodules of the Instabug module causes undefined error
1 parent 2113679 commit 7c0d2c0

File tree

10 files changed

+37
-16
lines changed

10 files changed

+37
-16
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,25 @@ public void setEnabledAttachmentTypes(boolean screenshot, boolean extraScreensho
554554
}
555555
}
556556

557+
/**
558+
* Sets whether attachments in bug reporting and in-app messaging are enabled or not.
559+
*
560+
* @param screenshot A boolean to enable or disable screenshot attachments.
561+
* @param {boolean} extraScreenShot A boolean to enable or disable extra screenshot attachments.
562+
* @param {boolean} galleryImage A boolean to enable or disable gallery image attachments.
563+
* @param {boolean} screenRecording A boolean to enable or disable screen recording attachments.
564+
*/
565+
@ReactMethod
566+
public void setEnabledAttachmentTypes(boolean screenshot, boolean extraScreenshot, boolean
567+
galleryImage, boolean screenRecording) {
568+
try {
569+
BugReporting.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage,
570+
screenRecording);
571+
} catch (Exception e) {
572+
e.printStackTrace();
573+
}
574+
}
575+
557576
/**
558577
* Gets tags.
559578
*

index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -950,11 +950,13 @@ const InstabugModule = {
950950
}
951951
};
952952

953-
InstabugModule.BugReporting = BugReporting;
954-
InstabugModule.Surveys = Surveys;
955-
InstabugModule.FeatureRequests = FeatureRequests;
956-
InstabugModule.Chats = Chats;
957-
InstabugModule.Replies = Replies;
958-
InstabugModule.CrashReporting = CrashReporting;
959-
960-
module.exports = InstabugModule;
953+
export {
954+
BugReporting,
955+
Surveys,
956+
FeatureRequests,
957+
Chats,
958+
Replies,
959+
CrashReporting
960+
}
961+
962+
export default InstabugModule;

modules/BugReporting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let { Instabug } = NativeModules;
1010
* BugReporting
1111
* @exports BugReporting
1212
*/
13-
module.exports = {
13+
export default {
1414
/**
1515
* Enables and disables manual invocation and prompt options for bug and feedback.
1616
* @param {boolean} isEnabled

modules/Chats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
* Chats
88
* @exports Chats
99
*/
10-
module.exports = {
10+
export default {
1111
/**
1212
* Enables and disables everything related to creating new chats.
1313
* @param {boolean} isEnabled

modules/CrashReporting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let { Instabug } = NativeModules;
66
* CrashReporting
77
* @exports CrashReporting
88
*/
9-
module.exports = {
9+
export default {
1010
/**
1111
* Enables and disables everything related to crash reporting including intercepting
1212
* errors in the global error handler. It is enabled by default.

modules/FeatureRequests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let {Instabug} = NativeModules;
55
* FeatureRequests
66
* @exports FeatureRequests
77
*/
8-
module.exports = {
8+
export default {
99

1010
/**
1111
* Sets whether users are required to enter an email address or not when

modules/Replies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let { Instabug } = NativeModules;
66
* Replies
77
* @exports Replies
88
*/
9-
module.exports = {
9+
export default {
1010
/**
1111
* Enables and disables everything related to receiving replies.
1212
* @param {boolean} isEnabled

modules/Surveys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let { Instabug } = NativeModules;
1010
* Surveys
1111
* @exports Surveys
1212
*/
13-
module.exports = {
13+
export default {
1414
/**
1515
* @summary Sets whether surveys are enabled or not.
1616
* If you disable surveys on the SDK but still have active surveys on your Instabug dashboard,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "instabug-reactnative",
3-
"version": "8.1.3",
3+
"version": "8.1.6",
44
"description": "React Native plugin for integrating the Instabug SDK",
55
"main": "index.js",
66
"types": "index.d.ts",

utils/InstabugUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ let init = () => {
4242
global.ErrorUtils.setGlobalHandler(errorHandler);
4343
};
4444

45-
module.exports = {
45+
export default {
4646
parseErrorStack: parseErrorStack,
4747
captureJsErrors: init
4848
};

0 commit comments

Comments
 (0)