Skip to content

Commit 0597a5c

Browse files
SalmaAliSalmaAli
authored andcommitted
📝 change setPromptOptionsEnabled to take ORed enums instead of booleans
1 parent 30c3722 commit 0597a5c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,8 +1434,23 @@ public void onDismiss() {
14341434
*/
14351435
@ReactMethod
14361436
public void setPromptOptionsEnabled(boolean chat, boolean bug, boolean feedback) {
1437+
1438+
ArrayList<PromptOption> options = new ArrayList<>();
1439+
1440+
if (chat) {
1441+
options.add(PromptOption.CHAT);
1442+
}
1443+
1444+
if (feedback) {
1445+
options.add(PromptOption.FEEDBACK);
1446+
}
1447+
1448+
if (bug) {
1449+
options.add(PromptOption.BUG);
1450+
}
1451+
14371452
try {
1438-
mInstabug.setPromptOptionsEnabled(chat, bug, feedback);
1453+
BugReporting.setPromptOptionsEnabled(options.toArray(new PromptOption[0]));
14391454
} catch (Exception e) {
14401455
e.printStackTrace();
14411456
}

0 commit comments

Comments
 (0)