Skip to content

Commit

Permalink
refactor(react-native): move native span options to a private static …
Browse files Browse the repository at this point in the history
…final field
  • Loading branch information
yousif-bugsnag committed Dec 2, 2024
1 parent a29dfef commit ecaa181
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class NativeBugsnagPerformanceImpl {

private boolean isNativePerformanceAvailable = false;

private static final SpanOptions BRIDGED_SPAN_OPTIONS = SpanOptions
.createFirstClass(true)
.makeCurrentContext(false)
.within(null);

public NativeBugsnagPerformanceImpl(ReactApplicationContext reactContext) {
this.reactContext = reactContext;

Expand Down Expand Up @@ -171,10 +176,7 @@ private WritableMap nativeSpanToJsSpan(SpanImpl nativeSpan) {
}

private SpanOptions readableMapToSpanOptions(ReadableMap jsOptions) {
SpanOptions spanOptions = SpanOptions.DEFAULTS
.setFirstClass(true)
.makeCurrentContext(false)
.within(null);
SpanOptions spanOptions = BRIDGED_SPAN_OPTIONS;

if (jsOptions.hasKey("startTime")) {
double startTime = jsOptions.getDouble("startTime");
Expand Down

0 comments on commit ecaa181

Please sign in to comment.