Commit 2f8f4e7
committed
Fix format selection when saving a palette in the Electron app
This commit addresses an issue in the Electron app where the file format
selected in the "Save as type" dropdown, or chosen by typing the file
extension, was not respected when saving a palette.
It saved always in GIMP Palette file format, due to the palette formats
not having defined `mimeType` properties.
Color palette formats have virtually no MIME type consensus, but using
the AnyPalette.js format identifiers works fine here.
For image formats, the `formatID` is the same as the `mimeType`, so this
change should have no effect on image file saving.
Steps to reproduce:
- Run the electron app: `npm run electron:start`
- Click Colors > Save Colors
- Select "Sketch palette (*.sketchpalette)" for "Save as type"
- Enter a file name (ending with .sketchpalette) and click Save
- The saved file should match the chosen format (JSON-based for Sketch)1 parent 806cca3 commit 2f8f4e7
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
0 commit comments