Open luceroweb opened 2 years ago
I was able to give somewhat of a solution by changing the value in the TextInput for Label in the ExpenseModal to value={appData?.modalMode === "add" ? undefined : label}
and by removing the lines that reset the values of label and amount after editing an expense. There was still an issue, however, if a user were to click the add expense button while already in the expenseDetails screen. The recommended solution is to refactor so that the label and amount are taken from state by id rather than having them be based on states that are passed in from the Overview Screen. I was unable to figure this out so I am going to unassign myself and return the ticket back to accepted so another developer can work on it.
Date Seen 6/6/22 11:50am
Versions Linux Chrome, Android Emulator (Pixel 4) https://github.com/luceroweb/karot-saving-smart/tree/develop
Bug Description When you edit an expense, and save your change, the edit is saved correctly. When you edit the same expense again, without leaving the expense detail view, the the expense data is not passed to the expense edit form, and submitting that form clears all of the expense data for that expense.
Steps to Reproduce
Actual Behavior When you edit an expense, and save your change, the edit is saved correctly. When you edit the same expense again, without leaving the expense detail view, the the expense data is not passed to the expense edit form, and submitting that form clears all of the expense data for that expense.
Expected Behavior When editing an expense the second time, the expense data should be passed into the expense edit form, and when the form is saved, the expense data and the extra money values should all be updated to reflect the change.
Troubleshooting/Testing Steps Attempted We set the default value of the Expense slice to an object like the following:
Attempted to edit an expense by adding value and by subtracting value.
Workaround Delete the expense and re-enter it.