Commit ea5a0bd
fix: Add Web Crypto feature detection for BotID in React Native WebView (calcom#24790)
* fix: Add Web Crypto feature detection for BotID in React Native WebView
Fixes calcom#24360
- Add feature detection to check for window.crypto availability before initializing BotID
- Skip BotID initialization in React Native WebView environments
- Prevents 'undefined is not an object (evaluating crypto)' error during booking
- BotID requires Web Crypto API which is not available in React Native WebView
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* refactor: Use minimal feature detection for BotID initialization
- Remove React Native WebView-specific check
- Use pure feature detection for Web Crypto API
- Check for window.crypto.getRandomValues availability
- Add SSR guard with typeof window check
This approach is more robust and environment-agnostic, working across
all environments that lack Web Crypto support, not just React Native.
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent 67c9fd9 commit ea5a0bd
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| 66 | + | |
0 commit comments