Conversation
…nalrobotics/feeding_web_interface into raidak/prevent_phone_sleep
There was a problem hiding this comment.
Hmm, as opposed to enabling NoSleep in every MealState that leads to RobotMotion, instead can't you enable it in the RobotMotion page instead? Specifically, in this useEffect you can call nosleep.enable() and then in the return value from that useEffect, you can call nosleep.disable(). In theory, that should enable nosleep every time the RobotMotion component mounts, and disable it every time the component unmounts. See here for more details on useEffect.
Let me know what you think. If you tried this, let me know why it didn't work.
amalnanavati
left a comment
There was a problem hiding this comment.
The code looks good. I'll test more on my mobile phone, with the actual robot, make any necessary changes, and merge it in after that.
Describe this pull request. Link to relevant GitHub issues, if any.
In service of issue #86
Explain how this pull request was tested, including but not limited to the below checkmarks.
In iPhone device, with EC2 link of updated pulled code.
Before creating a pull request
npm run formatpython3 -m black .in the top-level of this repositoryBefore merging a pull request
Squash and Merge)