Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/src/js/feedback/FeedbackWidgetManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
lazyLoadAutoInjectFeedbackButtonIntegration,
lazyLoadAutoInjectFeedbackIntegration,
lazyLoadAutoInjectScreenshotButtonIntegration,
lazyLoadShakeToReportIntegration,
} from './lazy';
import { startShakeListener, stopShakeListener } from './ShakeToReportBug';

Expand Down Expand Up @@ -146,6 +147,7 @@ let _imperativeShakeListenerStarted = false;

const enableFeedbackOnShake = (): void => {
lazyLoadAutoInjectFeedbackIntegration();
lazyLoadShakeToReportIntegration();
if (!_imperativeShakeListenerStarted) {
_imperativeShakeListenerStarted = startShakeListener(showFeedbackWidget);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/js/feedback/FeedbackWidgetProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
getScreenshotButtonOptions,
isShakeToReportEnabled,
} from './integration';
import { lazyLoadShakeToReportIntegration } from './lazy';
import { ScreenshotButton } from './ScreenshotButton';
import { startShakeListener, stopShakeListener } from './ShakeToReportBug';
import { isModalSupported, isNativeDriverSupportedForColorAnimations } from './utils';
Expand Down Expand Up @@ -123,6 +124,7 @@ export class FeedbackWidgetProvider extends React.Component<FeedbackWidgetProvid
});

if (isShakeToReportEnabled()) {
lazyLoadShakeToReportIntegration();
this._startedShakeListener = startShakeListener(showFeedbackWidget);
}
}
Expand Down
13 changes: 13 additions & 0 deletions packages/core/src/js/feedback/lazy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ export function lazyLoadAutoInjectFeedbackButtonIntegration(): void {
}
}

export const SHAKE_TO_REPORT_INTEGRATION_NAME = 'ShakeToReport';

/**
* Lazy loads the shake to report integration if it is not already loaded.
*/
export function lazyLoadShakeToReportIntegration(): void {
const integration = getClient()?.getIntegrationByName(SHAKE_TO_REPORT_INTEGRATION_NAME);
if (!integration) {
// Lazy load the integration to track usage
getClient()?.addIntegration({ name: SHAKE_TO_REPORT_INTEGRATION_NAME });
}
}

export const AUTO_INJECT_SCREENSHOT_BUTTON_INTEGRATION_NAME = 'AutoInjectMobileScreenshotButton';

/**
Expand Down
Loading