@worldcoin/mini-apps-ui-kit-react 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,15 +27,21 @@ const haptics = {
27
27
  };
28
28
  function withHaptics(fn, hapticFn = haptics.selection) {
29
29
  return (...args) => {
30
- if (!fn) {
30
+ try {
31
31
  hapticFn();
32
+ } catch (error) {
33
+ console.warn("Haptic feedback failed:", error);
34
+ }
35
+ if (!fn) {
32
36
  return void 0;
33
37
  }
34
38
  const result = fn(...args);
35
39
  if (result instanceof Promise) {
36
- return result.finally(() => hapticFn());
40
+ return result.catch((error) => {
41
+ console.error("Function failed:", error);
42
+ throw error;
43
+ });
37
44
  }
38
- hapticFn();
39
45
  return result;
40
46
  };
41
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/mini-apps-ui-kit-react",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",