Skip to content

addCustomLoadOverride and addCustomSaveOverride callbacks require a return value #22

@tdulcet

Description

@tdulcet

The AutomaticSettings.Trigger.addCustomLoadOverride() and AutomaticSettings.Trigger.addCustomSaveOverride() callbacks require a return value. The README says:

By default, the library assumes you now handle loading and saving by yourself, i.e. you need to interact with the HTML DOM (for loading) or the storage API (for saving) directly.

which implies that a return value should not be required. However, not providing the return value results in an exception, which prevents the options page from fully loading:
image

The issue is several lines like this:

// destructure data, if it has been returned, so next call can
// potentially also use it
if (result.command === CONTINUE_RESULT) {
that do not first check that the result from the callback is defined before using it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions