Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ability to add custom frame colors #4386

Merged
merged 1 commit into from
May 13, 2024
Merged

Conversation

garrettjstevens
Copy link
Collaborator

If you add a custom frame theme to your config.json like this:

{
  "configuration": {
    "theme": {
      "palette": {
        "frames": [
          null,
          { "main": "#FF8080" },
          { "main": "#80FF80" },
          { "main": "#8080FF" },
          { "main": "#8080FF" },
          { "main": "#80FF80" },
          { "main": "#FF8080" }
        ]
      }
    }
  }
}

you get an error:

TypeError: Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
/path/to/jbrowse-components/products/jbrowse-web/src/util.ts:135:1

This is because there's a null in the config, which I don't think we have anywhere else, and the addRelativeUris function was missing a null check. This PR adds the null check.

@garrettjstevens garrettjstevens added the bug Something isn't working label May 13, 2024
@garrettjstevens garrettjstevens self-assigned this May 13, 2024
@cmdcolin
Copy link
Collaborator

excellent. could be worth adding to some docs example too

@cmdcolin cmdcolin merged commit 1e131e0 into main May 13, 2024
10 checks passed
@cmdcolin cmdcolin deleted the fix_custom_frame_theme branch May 13, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants