Skip to content

Commit 14cb4fa

Browse files
committed
fix where stuff lives
1 parent bc9ce81 commit 14cb4fa

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

packages/ember/addon/instance-initializers/sentry-performance.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ export function initialize(appInstance: ApplicationInstance): void {
3131
}
3232

3333
// Run this in the next tick to ensure the ember router etc. is properly initialized
34-
setTimeout(() => {
35-
instrumentForPerformance(appInstance);
36-
});
34+
instrumentForPerformance(appInstance);
3735
}
3836

3937
export default {

packages/ember/addon/utils/browserTracingIntegration.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,26 @@ export function browserTracingIntegration(options: EmberBrowserTracingIntegratio
5454
afterAllSetup(client: BrowserClient) {
5555
integration.afterAllSetup(client);
5656

57-
instrumentEmberAppInstanceForPerformance(
58-
client,
59-
appInstance,
60-
appInstancePerformanceConfig,
61-
startBrowserTracingPageLoadSpan,
62-
startBrowserTracingNavigationSpan,
63-
);
57+
// Run this in the next tick to ensure the ember router etc. is properly initialized
58+
setTimeout(() => {
59+
instrumentEmberAppInstanceForPerformance(
60+
client,
61+
appInstance,
62+
appInstancePerformanceConfig,
63+
startBrowserTracingPageLoadSpan,
64+
startBrowserTracingNavigationSpan,
65+
);
6466

65-
// We only want to run this once in tests!
66-
if (macroCondition(isTesting())) {
67-
if (_initialized) {
68-
return;
67+
// We only want to run this once in tests!
68+
if (macroCondition(isTesting())) {
69+
if (_initialized) {
70+
return;
71+
}
6972
}
70-
}
7173

72-
instrumentGlobalsForPerformance(globalsPerformanceConfig);
73-
_initialized = true;
74+
instrumentGlobalsForPerformance(globalsPerformanceConfig);
75+
_initialized = true;
76+
});
7477
},
7578
};
7679
}

0 commit comments

Comments
 (0)