MCPcopy Create free account
hub / github.com/getsentry/sentry-react-native / check

Method check

packages/core/src/js/ragetap.ts:68–101  ·  view source on GitHub ↗

* Call after each touch event. If a rage tap is detected, a `ui.multiClick` * breadcrumb is emitted automatically.

(touchPath: TouchedComponentInfo[], label?: string)

Source from the content-addressed store, hash-verified

66 * breadcrumb is emitted automatically.
67 */
68 public check(touchPath: TouchedComponentInfo[], label?: string): void {
69 if (!this._enabled) {
70 return;
71 }
72
73 const root = touchPath[0];
74 if (!root) {
75 return;
76 }
77
78 const identity = getTapIdentity(root, label);
79 const now = Date.now();
80 const tapCount = this._detect(identity, now);
81
82 if (tapCount > 0) {
83 const message = buildTouchMessage(root, label);
84 const node = buildNodeFromTouchPath(root, label);
85
86 addBreadcrumb({
87 category: 'ui.multiClick',
88 type: 'default',
89 message,
90 data: {
91 clickCount: tapCount,
92 metric: true,
93 route: getCurrentRoute(),
94 node,
95 path: touchPath,
96 },
97 });
98
99 debug.log(`[TouchEvents] Rage tap detected: ${tapCount} taps on ${message}`);
100 }
101 }
102
103 /**
104 * Returns the tap count if rage tap is detected, 0 otherwise.

Callers 2

ragetap.test.tsFile · 0.80
_onTouchStartMethod · 0.80

Calls 7

_detectMethod · 0.95
addBreadcrumbFunction · 0.90
getTapIdentityFunction · 0.85
buildTouchMessageFunction · 0.85
buildNodeFromTouchPathFunction · 0.85
getCurrentRouteFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected