Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChristopher Badger
4,364 PointsWhy do we want the balance to reset to zero after an insufficient funds alert?
The actual balance still exists and is added to when we subsequently add funds. Shouldn't the balance keep the value present before the action that triggered the insufficient funds alert.
2 Answers
David Lin
35,864 PointsIt is a bug. Someone else wrote a fix for it here:
Gavin Hobbs
5,205 PointsHey Christopher Badger I'm confused about the same thing. I'm tempted to just leave that argument blank in the dismissAlert()
function. I think that might have been a typo or something.
Btw, Chukwuebuka Willie-Nwobu I think you might be confusing the Balance with the Total. The Total is how much is due for the current selection and the Balance is the amount of money the user is free to spend.
G'day!
-Gavin
Chukwuebuka Willie-Nwobu
2,739 PointsChukwuebuka Willie-Nwobu
2,739 PointsWe do this so that the user can start another purchase from scratch. Since they were unable to purchase an Item because they had insufficient funds, they can choose to buy another item, reduce the quantity or simply add more funds. :)