Skip to content

Commit e9ce530

Browse files
committed
avoid unecessary setup
1 parent d768343 commit e9ce530

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/replay/src/coreHandlers/handleNetworkBreadcrumbs.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ export function handleNetworkBreadcrumbs(replay: ReplayContainer): void {
4545
try {
4646
const textEncoder = new TextEncoder();
4747

48-
const handleFetch = handleFetchSpanListener(replay);
49-
const handleXhr = handleXhrSpanListener(replay);
50-
5148
const options: ExtendedNetworkBreadcrumbsOptions = {
5249
replay,
5350
textEncoder,
@@ -57,8 +54,8 @@ export function handleNetworkBreadcrumbs(replay: ReplayContainer): void {
5754
client.on('beforeAddBreadcrumb', (breadcrumb, hint) => handleNetworkBreadcrumb(options, breadcrumb, hint));
5855
} else {
5956
// Fallback behavior
60-
addInstrumentationHandler('fetch', handleFetch);
61-
addInstrumentationHandler('xhr', handleXhr);
57+
addInstrumentationHandler('fetch', handleFetchSpanListener(replay));
58+
addInstrumentationHandler('xhr', handleXhrSpanListener(replay));
6259
}
6360
} catch {
6461
// Do nothing

0 commit comments

Comments
 (0)