File tree Expand file tree Collapse file tree
packages/core/src/js/feedback Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 lazyLoadAutoInjectFeedbackButtonIntegration ,
66 lazyLoadAutoInjectFeedbackIntegration ,
77 lazyLoadAutoInjectScreenshotButtonIntegration ,
8+ lazyLoadShakeToReportIntegration ,
89} from './lazy' ;
910import { startShakeListener , stopShakeListener } from './ShakeToReportBug' ;
1011
@@ -155,6 +156,7 @@ let _imperativeShakeListenerStarted = false;
155156
156157const enableFeedbackOnShake = ( ) : void => {
157158 lazyLoadAutoInjectFeedbackIntegration ( ) ;
159+ lazyLoadShakeToReportIntegration ( ) ;
158160 if ( ! _imperativeShakeListenerStarted ) {
159161 _imperativeShakeListenerStarted = startShakeListener ( showFeedbackForm ) ;
160162 }
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
3737 getScreenshotButtonOptions ,
3838 isShakeToReportEnabled ,
3939} from './integration' ;
40+ import { lazyLoadShakeToReportIntegration } from './lazy' ;
4041import { ScreenshotButton } from './ScreenshotButton' ;
4142import { startShakeListener , stopShakeListener } from './ShakeToReportBug' ;
4243import { isModalSupported , isNativeDriverSupportedForColorAnimations } from './utils' ;
@@ -123,6 +124,7 @@ export class FeedbackFormProvider extends React.Component<FeedbackFormProviderPr
123124 } ) ;
124125
125126 if ( isShakeToReportEnabled ( ) ) {
127+ lazyLoadShakeToReportIntegration ( ) ;
126128 this . _startedShakeListener = startShakeListener ( showFeedbackForm ) ;
127129 }
128130 }
Original file line number Diff line number Diff line change @@ -39,6 +39,19 @@ export function lazyLoadAutoInjectFeedbackButtonIntegration(): void {
3939 }
4040}
4141
42+ export const SHAKE_TO_REPORT_INTEGRATION_NAME = 'ShakeToReport' ;
43+
44+ /**
45+ * Lazy loads the shake to report integration if it is not already loaded.
46+ */
47+ export function lazyLoadShakeToReportIntegration ( ) : void {
48+ const integration = getClient ( ) ?. getIntegrationByName ( SHAKE_TO_REPORT_INTEGRATION_NAME ) ;
49+ if ( ! integration ) {
50+ // Lazy load the integration to track usage
51+ getClient ( ) ?. addIntegration ( { name : SHAKE_TO_REPORT_INTEGRATION_NAME } ) ;
52+ }
53+ }
54+
4255export const AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileScreenshotButton' ;
4356
4457/**
You can’t perform that action at this time.
0 commit comments