Description:
Open this on an iPhone, and accept permissions for device orientation.
Logs show that events are created in the following order:
- Granted (this is a bogus event, should not be generated).
- Requested
- Granted
The bug is here
The code is structued as
requestPermission.catch().then()
This means that the "then" branch gets executed even when an exception is caught in the requestPermission. Which results in the behaviour above.
Fix is to switch the catch() and then() branches. I'll submit a PR for this.