-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure meal is only saved once #248
Conversation
Disables `Save and continue` button once pressed by utilizing new `mealSaved` flag. Renames `saved` to `noteSaved`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, and seems to do what it says.
There is no noticeable impact on the workflow for normal carb entries, and the mealSaved
flag should be set to true
as soon as the "Save and continue" button is pressed, and should block a second entry if the app is hanging.
I also tested changing @State var mealSaved
from false
to true
to confirm that this state would disable the "Save and continue" button. This disabled the button as expected.
LGTM!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments, tested in vitro and in vivo with 0 issue and was unable to reproduce initial issue (which is a good thing in this case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basing approval on code review only. LGTM. Precise, intentional changes. We have two test accounts by experienced testers.
Merging with 2 testers (in-vitro and in-vivo) and 3 approvals. |
From the code, I'm pretty confident the button won't be able to be pressed twice, but I've still been spamming the "save" button every time I log meals the past few days and haven't had it trigger twice, even when purposely entering during a loop cycle. |
Save and continue
button after it's pressed until the AddCarbs module is reopened.saved
flag tonoteSaved
for clarity.