File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,6 @@ export const createSentryPiniaPlugin: (options?: SentryPiniaPluginOptions) => Pi
7272 const client = getClient ( ) ;
7373 const options = client && client . getOptions ( ) ;
7474 const normalizationDepth = ( options && options . normalizeDepth ) || 3 ; // default state normalization depth to 3
75-
7675 const newStateContext = { state : { type : 'pinia' , value : transformedState } } ;
7776
7877 addNonEnumerableProperty (
@@ -82,9 +81,15 @@ export const createSentryPiniaPlugin: (options?: SentryPiniaPluginOptions) => Pi
8281 normalizationDepth , // rest for the actual state
8382 ) ;
8483
85- scope . setContext ( 'state' , newStateContext ) ;
84+ scope . setContext ( 'state' , {
85+ ...scope . getScopeData ( ) . contexts . state ,
86+ newStateContext,
87+ } ) ;
8688 } else {
87- scope . setContext ( 'state' , null ) ;
89+ scope . setContext ( 'state' , {
90+ ...scope . getScopeData ( ) . contexts . state ,
91+ state : { type : 'pinia' , value : 'undefined' } ,
92+ } ) ;
8893 }
8994 } ) ;
9095 } ) ;
You can’t perform that action at this time.
0 commit comments