Skip to content

Commit bb48502

Browse files
committed
Lint fix
1 parent bd042fd commit bb48502

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • packages/core/src/js/tracing

packages/core/src/js/tracing/span.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
spanToJSON,
1313
startIdleSpan as coreStartIdleSpan,
1414
} from '@sentry/core';
15-
import { AppState } from 'react-native';
15+
import { AppState, Platform } from 'react-native';
1616
import { isRootSpan } from '../utils/span';
1717
import { adjustTransactionDuration, cancelInBackground } from './onSpanEndUtils';
1818
import {
@@ -118,8 +118,10 @@ export const startIdleSpan = (
118118
}
119119

120120
const currentAppState = AppState.currentState;
121-
if (currentAppState === 'background' || currentAppState === 'inactive') {
122-
debug.log(`[startIdleSpan] App is already in '${currentAppState}' state, not starting span for ${startSpanOption.name}`);
121+
if (currentAppState === 'background' || (Platform.OS === 'ios' && currentAppState === 'inactive')) {
122+
debug.log(
123+
`[startIdleSpan] App is already in '${currentAppState}' state, not starting span for ${startSpanOption.name}`,
124+
);
123125
return new SentryNonRecordingSpan();
124126
}
125127

0 commit comments

Comments
 (0)