@@ -43,7 +43,7 @@ export async function normalizeTransactionName(
43
43
prevTransactionName = window . location . pathname ;
44
44
}
45
45
46
- const transactionName : string | undefined = await new Promise ( function ( resolve ) {
46
+ const transactionName : string = await new Promise ( function ( resolve ) {
47
47
Router . match (
48
48
{
49
49
routes : appRoutes ,
@@ -52,7 +52,7 @@ export async function normalizeTransactionName(
52
52
( error , _redirectLocation , renderProps ) => {
53
53
if ( error ) {
54
54
set ( event , [ 'tags' , 'transaction.rename.router-match' ] , 'error' ) ;
55
- return resolve ( undefined ) ;
55
+ return resolve ( window . location . pathname ) ;
56
56
}
57
57
58
58
set ( event , [ 'tags' , 'transaction.rename.router-match' ] , 'success' ) ;
@@ -68,14 +68,12 @@ export async function normalizeTransactionName(
68
68
) ;
69
69
} ) ;
70
70
71
- if ( typeof transactionName === 'string' && transactionName . length ) {
72
- event . transaction = transactionName ;
71
+ event . transaction = transactionName ;
73
72
74
- set ( event , [ 'tags' , 'transaction.rename.before' ] , prevTransactionName ) ;
75
- set ( event , [ 'tags' , 'transaction.rename.after' ] , transactionName ) ;
73
+ set ( event , [ 'tags' , 'transaction.rename.before' ] , prevTransactionName ) ;
74
+ set ( event , [ 'tags' , 'transaction.rename.after' ] , transactionName ) ;
76
75
77
- set ( event , [ 'tags' , 'ui.route' ] , transactionName ) ;
78
- }
76
+ set ( event , [ 'tags' , 'ui.route' ] , transactionName ) ;
79
77
80
78
return event ;
81
79
}
0 commit comments