mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 05:12:33 +00:00
* 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.
Tauri + React + Typescript
This template should help get you started developing with Tauri, React and Typescript in Vite.