File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -131,9 +131,8 @@ interface Monitor {
131131 interactions : Array < InternalInteraction > ;
132132 session : ReturnType < typeof getSession > ;
133133 url : string | null ;
134- apiKey : string | null ;
135134 route : string | null ;
136- path : string | null ;
135+ apiKey : string | null ;
137136 commit : string | null ;
138137 branch : string | null ;
139138}
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ export interface MonitoringWithoutRouteProps
4242export const Monitoring = ( {
4343 url,
4444 apiKey,
45- path = null , // path passed down would be reactive
4645 params,
46+ path = null , // path passed down would be reactive
4747 route = null ,
4848 commit = null ,
4949 branch = null ,
@@ -59,19 +59,18 @@ export const Monitoring = ({
5959 url,
6060 apiKey,
6161 route,
62- path,
6362 commit,
6463 branch,
6564 } ;
65+
6666 // When using Monitoring without framework, we need to compute the route from the path and params
6767 if ( ! route && path && params ) {
6868 Store . monitor . value . route = computeRoute ( path , params ) ;
6969 } else {
70- Store . monitor . value . route = route ?? new URL ( window . location . toString ( ) ) . pathname ;
70+ Store . monitor . value . route =
71+ route ?? path ?? new URL ( window . location . toString ( ) ) . pathname ; // this is inaccurate on vanilla react if the path is not provided but used for session route
7172 }
7273
73- Store . monitor . value . path = path ?? new URL ( window . location . toString ( ) ) . pathname ;
74-
7574 // eslint-disable-next-line import/no-named-as-default-member
7675 React . useEffect ( ( ) => {
7776 scanMonitoring ( { enabled : true } ) ;
You can’t perform that action at this time.
0 commit comments