Skip to content

Commit

Permalink
make setInvocationEvent threadsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetzel committed Nov 9, 2018
1 parent 3dde3a7 commit 8cb4ee6
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,17 @@ public void getUnreadMessagesCount(Callback messageCountCallback) {
* @see InstabugInvocationEvent
*/
@ReactMethod
public void setInvocationEvent(String invocationEventValue) {
try {
BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue));
} catch (Exception e) {
e.printStackTrace();
}
public void setInvocationEvent(final String invocationEventValue) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
try {
BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue));
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
Expand Down

0 comments on commit 8cb4ee6

Please sign in to comment.