File tree 1 file changed +8
-3
lines changed
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
72
72
const client = getClient ( ) ;
73
73
const options = client && client . getOptions ( ) ;
74
74
const normalizationDepth = ( options && options . normalizeDepth ) || 3 ; // default state normalization depth to 3
75
-
76
75
const newStateContext = { state : { type : 'pinia' , value : transformedState } } ;
77
76
78
77
addNonEnumerableProperty (
@@ -82,9 +81,15 @@ export const createSentryPiniaPlugin: (options?: SentryPiniaPluginOptions) => Pi
82
81
normalizationDepth , // rest for the actual state
83
82
) ;
84
83
85
- scope . setContext ( 'state' , newStateContext ) ;
84
+ scope . setContext ( 'state' , {
85
+ ...scope . getScopeData ( ) . contexts . state ,
86
+ newStateContext,
87
+ } ) ;
86
88
} else {
87
- scope . setContext ( 'state' , null ) ;
89
+ scope . setContext ( 'state' , {
90
+ ...scope . getScopeData ( ) . contexts . state ,
91
+ state : { type : 'pinia' , value : 'undefined' } ,
92
+ } ) ;
88
93
}
89
94
} ) ;
90
95
} ) ;
You can’t perform that action at this time.
0 commit comments