Skip to content

Commit e477a74

Browse files
authored
Merge branch 'main' into fix/e2e-stable-checks
2 parents aa45e32 + c26570f commit e477a74

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

packages/core/src/js/feedback/FeedbackWidgetManager.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
lazyLoadAutoInjectFeedbackButtonIntegration,
66
lazyLoadAutoInjectFeedbackIntegration,
77
lazyLoadAutoInjectScreenshotButtonIntegration,
8+
lazyLoadShakeToReportIntegration,
89
} from './lazy';
910
import { startShakeListener, stopShakeListener } from './ShakeToReportBug';
1011

@@ -146,6 +147,7 @@ let _imperativeShakeListenerStarted = false;
146147

147148
const enableFeedbackOnShake = (): void => {
148149
lazyLoadAutoInjectFeedbackIntegration();
150+
lazyLoadShakeToReportIntegration();
149151
if (!_imperativeShakeListenerStarted) {
150152
_imperativeShakeListenerStarted = startShakeListener(showFeedbackWidget);
151153
}

packages/core/src/js/feedback/FeedbackWidgetProvider.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
getScreenshotButtonOptions,
3838
isShakeToReportEnabled,
3939
} from './integration';
40+
import { lazyLoadShakeToReportIntegration } from './lazy';
4041
import { ScreenshotButton } from './ScreenshotButton';
4142
import { startShakeListener, stopShakeListener } from './ShakeToReportBug';
4243
import { isModalSupported, isNativeDriverSupportedForColorAnimations } from './utils';
@@ -123,6 +124,7 @@ export class FeedbackWidgetProvider extends React.Component<FeedbackWidgetProvid
123124
});
124125

125126
if (isShakeToReportEnabled()) {
127+
lazyLoadShakeToReportIntegration();
126128
this._startedShakeListener = startShakeListener(showFeedbackWidget);
127129
}
128130
}

packages/core/src/js/feedback/lazy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
4255
export const AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileScreenshotButton';
4356

4457
/**

0 commit comments

Comments
 (0)