Skip to content

Commit 140ba26

Browse files
committed
Replace Hub with Scopes
1 parent 0828c2b commit 140ba26

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
import com.facebook.react.common.JavascriptException;
3030
import com.facebook.react.modules.core.DeviceEventManagerModule;
3131
import io.sentry.Breadcrumb;
32-
import io.sentry.HubAdapter;
3332
import io.sentry.ILogger;
3433
import io.sentry.IScope;
3534
import io.sentry.ISentryExecutorService;
3635
import io.sentry.ISerializer;
3736
import io.sentry.Integration;
37+
import io.sentry.ScopesAdapter;
3838
import io.sentry.Sentry;
3939
import io.sentry.SentryDate;
4040
import io.sentry.SentryDateProvider;
@@ -506,7 +506,7 @@ public void fetchNativeFrames(Promise promise) {
506506
}
507507

508508
public void captureReplay(boolean isHardCrash, Promise promise) {
509-
Sentry.getCurrentHub().getOptions().getReplayController().captureReplay(isHardCrash);
509+
Sentry.getCurrentScopes().getOptions().getReplayController().captureReplay(isHardCrash);
510510
promise.resolve(getCurrentReplayId());
511511
}
512512

@@ -602,7 +602,7 @@ public void fetchViewHierarchy(Promise promise) {
602602
return;
603603
}
604604

605-
ISerializer serializer = HubAdapter.getInstance().getOptions().getSerializer();
605+
ISerializer serializer = ScopesAdapter.getInstance().getOptions().getSerializer();
606606
final @Nullable byte[] bytes =
607607
JsonSerializationUtils.bytesFrom(serializer, logger, viewHierarchy);
608608
if (bytes == null) {
@@ -828,7 +828,7 @@ public WritableMap startProfiling(boolean platformProfilers) {
828828
}
829829

830830
public WritableMap stopProfiling() {
831-
final boolean isDebug = HubAdapter.getInstance().getOptions().isDebug();
831+
final boolean isDebug = ScopesAdapter.getInstance().getOptions().isDebug();
832832
final WritableMap result = new WritableNativeMap();
833833
File output = null;
834834
try {
@@ -914,7 +914,7 @@ private String readStringFromFile(File path) throws IOException {
914914
}
915915

916916
public void fetchNativeDeviceContexts(Promise promise) {
917-
final @NotNull SentryOptions options = HubAdapter.getInstance().getOptions();
917+
final @NotNull SentryOptions options = ScopesAdapter.getInstance().getOptions();
918918
final @Nullable Context context = this.getReactApplicationContext().getApplicationContext();
919919
final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope();
920920
fetchNativeDeviceContexts(promise, options, context, currentScope);
@@ -951,7 +951,8 @@ protected void fetchNativeDeviceContexts(
951951
}
952952

953953
public void fetchNativeSdkInfo(Promise promise) {
954-
final @Nullable SdkVersion sdkVersion = HubAdapter.getInstance().getOptions().getSdkVersion();
954+
final @Nullable SdkVersion sdkVersion =
955+
ScopesAdapter.getInstance().getOptions().getSdkVersion();
955956
if (sdkVersion == null) {
956957
promise.resolve(null);
957958
} else {

0 commit comments

Comments
 (0)