Skip to content

Rejecting promise in registerSave callback should revert changes to options page #21

@tdulcet

Description

@tdulcet

Rejecting the promise in a registerSave callback should automatically revert any changes to the option page.

This line assumes that the promises will always resolve:

const saveTriggerValue = await Trigger.runSaveTrigger(option, optionValue, event);

It produces an "uncaught exception" error if they do not, which leaves the options page in an invalid state:
image
This is particularity an issue when using the PermissionRequest library.

The solution is probably for the library to call preventDefault() whenever the promise is rejected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions