Files
openhuman/app
Steven EnamakelandGitHub 38eb934242 Add coupon redemption to Rewards page (#471)
* Add coupon redemption to Rewards page

* Format Rewards coupon changes

* refactor: enhance coupon redemption logic and error handling in Rewards section

- Updated the coupon redemption process to utilize Promise.allSettled for improved error handling during state refresh.
- Adjusted the display logic for redeemed coupons to ensure clarity when no rewards are available.
- Refactored the normalization of coupon redeem results to streamline data extraction from the API response.

These changes improve the robustness and user experience of the Rewards feature.

* test: add unit tests for coupon redemption and balance display in Rewards section

- Introduced a new test case to validate the display of pending coupon messages and ensure the current balance remains unchanged until the reward is fulfilled.
- Enhanced existing tests for the `redeemCoupon` function to verify the unwrapping of nested success/data payloads.
- Updated the `RewardsCouponSection` component to improve the conditional rendering logic for better clarity.

These changes enhance test coverage and ensure the correctness of coupon handling in the Rewards feature.

* test: simplify data structure in redeemCoupon test case

- Refactored the `redeemCoupon` test case to streamline the data structure for the success response, enhancing readability and maintainability.
- This change improves the clarity of the test while ensuring it continues to validate the unwrapping of nested success/data payloads effectively.
2026-04-09 20:02:04 -07:00
..
2026-03-29 10:30:18 -07:00
2026-03-29 10:30:18 -07:00
2026-03-29 10:30:18 -07:00
2026-03-29 10:30:18 -07:00
2026-03-29 10:30:18 -07:00

Tauri + React + Typescript

This template should help get you started developing with Tauri, React and Typescript in Vite.