Skip to content

Commit 4e074ef

Browse files
authored
📝 improve Replies.hasChats API to be invoked when there are no chats with a returned value false
1 parent 3bb69ec commit 4e074ef

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,9 +1666,8 @@ public void run() {
16661666
@ReactMethod
16671667
public void hasChats(Callback callback) {
16681668
boolean hasChats = Replies.hasChats();
1669-
if (hasChats) {
1670-
callback.invoke();
1671-
}
1669+
callback.invoke(hasChats);
1670+
16721671
}
16731672

16741673
@ReactMethod

ios/RNInstabug/InstabugReactBridge.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,8 @@ - (dispatch_queue_t)methodQueue {
567567

568568
RCT_EXPORT_METHOD(hasChats:(RCTResponseSenderBlock) callback) {
569569
BOOL hasChats = IBGReplies.hasChats;
570-
if (hasChats) {
571-
callback(nil);
572-
573-
}
570+
callback(@[@(hasChats)]);
571+
574572
}
575573

576574
RCT_EXPORT_METHOD(showReplies) {

0 commit comments

Comments
 (0)