input-output-hk / dapps-certification-web

Certification as a service for the Cardano dApps platform
Apache License 2.0
5 stars 0 forks source link

PLT-7439 Fix for Blank page in the tool at times #10

Closed amnambiar closed 1 year ago

amnambiar commented 1 year ago

https://input-output.atlassian.net/browse/PLT-7439

Across BE master

Summary by CodeRabbit

Refactor:

New Feature:

Bug Fix:

Chore:

coderabbitai[bot] commented 1 year ago

Walkthrough

This pull request simplifies state initialization using the useLocalStorage hook across multiple components, enhancing readability and reducing complexity. It also introduces robust error handling mechanisms, including a new utility function getErrorMessage, to improve user experience during unexpected scenarios.

Changes

File(s) Summary
src/components/ConnectWallet/ConnectWallet.tsx,
src/components/Header/Header.tsx,
src/pages/home/Home.tsx,
src/pages/userProfile/UserProfile.tsx
Simplified state initialization using useLocalStorage hook, improving code readability and maintainability.
src/hooks/useLocalStorage.ts,
src/hooks/useLogs.ts
Enhanced useLocalStorage hook to handle different types of values and prevent storing empty or null values. Removed unnecessary code in useLogs.
src/pages/certification/Certification.tsx,
src/pages/subscription/payment/Payment.tsx
Introduced robust error handling with getErrorMessage utility function. Improved user experience during unexpected scenarios.
src/components/PrivateRoutes/PrivateRoutes.tsx Added checks to ensure user is logged in before accessing private routes, enhancing security.
src/utils/utils.ts Added getErrorMessage function to generate appropriate error messages based on error object properties.

"In the land of code, where logic is king, ๐Ÿคด๐Ÿ‘‘
A rabbit hopped by, making changes with a swing. ๐Ÿ‡๐Ÿ’ป
State simplified, errors handled with care, ๐ŸŽฏ๐Ÿ› ๏ธ
Making the codebase cleaner, lighter, and fair. ๐Ÿงนโœจ"


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume.