Skip to content

device-orientation-permission-ui incorrectly emits deviceorientationpermissiongranted too early #5078

@diarmidmackenzie

Description

@diarmidmackenzie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions