Skip to content

Stored values not restored #5

Description

@adamjkb

Describe the bug

Values aren't actually restored from cache/localstorage because the return type of Preferences.get doesn't match the react-native async storage API's.
As a result parseData function always returns the fallback.

Essentially here it should be something like persistedData.value

const parseData = (persistedData: any, fallback: any) => {
try {
if (persistedData)
return JSON.parse(persistedData)
}
catch (_err) {}
return fallback
}

Reproduction

N/A

System Info

N/A

Used Package Manager

n/a

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions