Skip to content

fix: resolve dosha quiz result crash by mapping result codes#125

Open
ajitkumarsaini02 wants to merge 5 commits into
udisha1:mainfrom
ajitkumarsaini02:fix-dosha-quiz-clean
Open

fix: resolve dosha quiz result crash by mapping result codes#125
ajitkumarsaini02 wants to merge 5 commits into
udisha1:mainfrom
ajitkumarsaini02:fix-dosha-quiz-clean

Conversation

@ajitkumarsaini02

Copy link
Copy Markdown
Contributor

Fixes #100

Problem

The Dosha Quiz calculated results using character codes (V, P, K) but attempted to look up dosha metadata using lowercase class identifiers (vata, pitta, kapha). This mismatch caused the lookup to fail, resulting in primaryDosha being undefined and causing the UI to crash when displaying quiz results.

Changes Made

  • Added mapping between quiz result codes and dosha class identifiers.
  • Updated calculateResult() to use the correct dosha lookup.
  • Added defensive handling for invalid dosha lookups.
  • Added missing styling properties (bg, color) for result rendering.
  • Updated result template to render only when primaryDosha is available.

Testing

  • Completed the Dosha Quiz flow.
  • Verified Vata, Pitta, and Kapha results display correctly.
  • Confirmed no runtime errors occur after quiz completion.

Result

The application no longer crashes after completing the Dosha Quiz, and the correct dosha result is displayed consistently.

@udisha1

udisha1 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

plz provide the screenshot of the changes made

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@ajitkumarsaini02 is attempting to deploy a commit to the Udisha Narayan's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Application Crash in Dosha Quiz Results (Bug )

2 participants