File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ type PiniaPlugin = (context: {
12
12
13
13
type SentryPiniaPluginOptions = {
14
14
attachPiniaState ?: boolean ;
15
+ addBreadcrumbs ?: boolean ;
15
16
actionTransformer ?: ( action : any ) => any ;
16
17
stateTransformer ?: ( state : any ) => any ;
17
18
} ;
@@ -48,10 +49,14 @@ export const createSentryPiniaPlugin: (options?: SentryPiniaPluginOptions) => Pi
48
49
store . $onAction ( context => {
49
50
context . after ( ( ) => {
50
51
const transformedActionName = options . actionTransformer
51
- ? options . actionTransformer ( context . name ) || ''
52
+ ? options . actionTransformer ( context . name )
52
53
: context . name ;
53
54
54
- if ( typeof transformedActionName !== 'undefined' && transformedActionName !== null ) {
55
+ if (
56
+ typeof transformedActionName !== 'undefined' &&
57
+ transformedActionName !== null &&
58
+ options . addBreadcrumbs !== false
59
+ ) {
55
60
addBreadcrumb ( {
56
61
category : 'action' ,
57
62
message : transformedActionName ,
You can’t perform that action at this time.
0 commit comments