also looking at this
fix(ios): hand the page the answers native was already sending
#222
18 files
+597
-164
| @@ -5,7 +5,14 @@ export function haptic(node: HTMLElement, type: string = 'selection') { | ||
| 5 | 5 | const handleClick = async () => { |
| 6 | 6 | const _$craft = get(craft); |
| 7 | 7 | if (!_$craft) return; |
| 8 | await _$craft.haptic(type); | |
| 8 | try { | |
| 9 | await _$craft.haptic(type); | |
| 10 | } | |
| 11 | catch (error) { | |
| 12 | // Feedback: an app built with haptics off plays nothing on click, rather | |
| 13 | // than an unhandled rejection. Any other failure still surfaces. | |
| 14 | if ((error as { code?: string } | null)?.code !== 'CAPABILITY_DISABLED') throw error; | |
| 15 | } | |
| 9 | 16 | }; |
| 10 | 17 | |
| 11 | 18 | node.addEventListener('click', handleClick); |