Skip to content

Commit 4af9057

Browse files
committed
pr feedback
1 parent a1bcf73 commit 4af9057

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/tracing-internal/src/browser/browserTracingIntegration.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable max-lines, complexity */
22
import type { IdleTransaction } from '@sentry/core';
3-
import { getClient } from '@sentry/core';
43
import { getCurrentHub } from '@sentry/core';
54
import {
65
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
@@ -11,6 +10,7 @@ import {
1110
startIdleTransaction,
1211
} from '@sentry/core';
1312
import type {
13+
Client,
1414
IntegrationFn,
1515
StartSpanOptions,
1616
Transaction,
@@ -336,7 +336,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
336336
origin: 'auto.pageload.browser',
337337
metadata: { source: 'url' },
338338
};
339-
startBrowserTracingPageLoadSpan(context);
339+
startBrowserTracingPageLoadSpan(client, context);
340340
}
341341

342342
if (options.instrumentNavigation && client.emit) {
@@ -364,7 +364,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
364364
metadata: { source: 'url' },
365365
};
366366

367-
startBrowserTracingNavigationSpan(context);
367+
startBrowserTracingNavigationSpan(client, context);
368368
}
369369
});
370370
}
@@ -395,8 +395,8 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
395395
* Manually start a page load span.
396396
* This will only do something if the BrowserTracing integration has been setup.
397397
*/
398-
export function startBrowserTracingPageLoadSpan(spanOptions: StartSpanOptions, client = getClient()): void {
399-
if (!client || !client.emit) {
398+
export function startBrowserTracingPageLoadSpan(client: Client, spanOptions: StartSpanOptions): void {
399+
if (!client.emit) {
400400
return;
401401
}
402402

@@ -407,8 +407,8 @@ export function startBrowserTracingPageLoadSpan(spanOptions: StartSpanOptions, c
407407
* Manually start a navigation span.
408408
* This will only do something if the BrowserTracing integration has been setup.
409409
*/
410-
export function startBrowserTracingNavigationSpan(spanOptions: StartSpanOptions, client = getClient()): void {
411-
if (!client || !client.emit) {
410+
export function startBrowserTracingNavigationSpan(client: Client, spanOptions: StartSpanOptions): void {
411+
if (!client.emit) {
412412
return;
413413
}
414414

0 commit comments

Comments
 (0)