Closed nkfoss closed 3 years ago
Update: When deleting the last exercise of a previously saved workout, it does not re-instate that last exercise, but it actually reinstsates THE ENTIRE WORKOUT that was saved last. This is a bit more informative of the problem.
New problem: It seems that fetchWorkout() is being called by multiple componnents, though I think it should only be called by the set-list component (for simplicity). This should be sorted out first.
It is called twice because fetchWorkout()
is called in SetListComponent's
ngOnInit()
twice. Once via calling handleRouteParams()
which uses fetchWorkout()
, and then fetchWorkout()
in an if/else
in init.
Good catch. The fetchWorkout issue had been resolved, but a recent commit made it a problem again.
In handleRouteParams, I assumed that I was only setting up the subscription to the route params, and not actually calling fetchWorkout. This will need to be changed.
If you load a previously saved workout, and there is only one exercise, you cannot delete it.
It will appear to be deleted, but will quickly appear again. This is probably related to some check of the length of the exercise array...