Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich committed Feb 2, 2024
1 parent 84b1f5c commit 8fdc243
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export {
close,
captureUserFeedback,
withScope,
// eslint-disable-next-line deprecation/deprecation
configureScope,
} from './sdk';
export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
Expand Down
8 changes: 4 additions & 4 deletions src/js/touchevents.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { addBreadcrumb, getCurrentHub } from '@sentry/core';
import { addBreadcrumb, getClient } from '@sentry/core';
import type { SeverityLevel } from '@sentry/types';
import { logger } from '@sentry/utils';
import * as React from 'react';
import type { GestureResponderEvent} from 'react-native';
import { StyleSheet, View } from 'react-native';

import { createIntegration } from './integrations/factory';
import { ReactNativeTracing } from './tracing';
import type { ReactNativeTracing } from './tracing';
import { UI_ACTION_TOUCH } from './tracing/ops';

export type TouchEventBoundaryProps = {
Expand Down Expand Up @@ -88,10 +88,10 @@ class TouchEventBoundary extends React.Component<TouchEventBoundaryProps> {
* Registers the TouchEventBoundary as a Sentry Integration.
*/
public componentDidMount(): void {
const client = getCurrentHub().getClient();
const client = getClient();
client?.addIntegration?.(createIntegration(this.name));
if (!this._tracingIntegration && client) {
this._tracingIntegration = client.getIntegration(ReactNativeTracing);
this._tracingIntegration = client.getIntegrationByName?.('ReactNativeTracing') as ReactNativeTracing|| null;
}
}

Expand Down

0 comments on commit 8fdc243

Please sign in to comment.