primer / prism

A tool for creating and maintaining cohesive, consistent, and accessible color palettes
https://primer.style/prism/
MIT License
667 stars 39 forks source link

App crashes when an empty scale is opened #45

Closed rafaeltab closed 2 years ago

rafaeltab commented 2 years ago

Describe the bug App crashes when an empty scale is opened

To Reproduce

  1. Create a new palette
  2. Import the following JSON
    {
    "lightgrey": [],
    "dimgrey": [],
    "olivedrab": "#6b8e23"
    }
  3. select either the lightgrey or dimgrey scales

Expected behavior An empty scale should be displayed, it should allow adding a color using the + button. Optionally, the pane on the right could continue to function but without displaying any color settings, just the scale settings.

P.S. Sorry for not making this issue earlier

pavelkeyzik commented 2 years ago

I'll take it 😊

pavelkeyzik commented 2 years ago

Hey @rafaeltab it should be fixed. Now you wouldn't be able to import something with empty scale 😊 If you're happy with the result, please, close the issue

rafaeltab commented 2 years ago

Looks like you can no longer import empty scales. For anyone landing on this issue, please keep in mind that if you have a bugged scale, caused by this problem, you should export the palette, remove the bugged scale and import it into a brand-new palette.