arduino / Arduino-Science-Journal-iOS

Use the sensors in your mobile devices to perform science experiments. Science doesn’t just happen in the classroom or lab—tools like Science Journal let you see how the world works with just your phone.
http://arduino.cc/education
Apache License 2.0
22 stars 9 forks source link

Fix a crash when (un)archiving a trial #62

Closed emiliopavia closed 3 years ago

emiliopavia commented 3 years ago

Checklist

Motivation and Context

After switching to the new action area there was a crash when trying to archive/unarchive a trial in an experiment. This PR fixes those crashes.

Description

Inside TrialDetailViewController you can archive the open trial. In the old version of the UI, the trial detail had an "Add Notes" cell that was removed after archiving the trial, and added after unarchiving it. This cell doesn't exist anymore with the new action area, but the old code was still present. I've added a check in order to toggle the cell only if it's present (i.e. the action area feature is disabled). I've also modified the code in order to disable/enable the action area along with the archive/unarchive action.