fix: bidirectional eingabe update, hexToHsl null check, import validation, harmony umlauts
This commit is contained in:
@@ -108,14 +108,17 @@ export function importCollection() {
|
||||
const data = load();
|
||||
const existingFavHexes = new Set(data.favoriten.map(hslToHex));
|
||||
(imported.favoriten || []).forEach(hsl => {
|
||||
if (!hsl || typeof hsl.h !== 'number' || typeof hsl.s !== 'number' || typeof hsl.l !== 'number') return;
|
||||
if (!existingFavHexes.has(hslToHex(hsl))) data.favoriten.push(hsl);
|
||||
});
|
||||
const existingSchemaNames = new Set(data.schemata.map(s => s.name));
|
||||
(imported.schemata || []).forEach(s => {
|
||||
if (!s || typeof s.name !== 'string' || !Array.isArray(s.farben)) return;
|
||||
if (!existingSchemaNames.has(s.name)) data.schemata.push(s);
|
||||
});
|
||||
const existingHistHexes = new Set(data.history.map(hslToHex));
|
||||
(imported.history || []).forEach(hsl => {
|
||||
if (!hsl || typeof hsl.h !== 'number' || typeof hsl.s !== 'number' || typeof hsl.l !== 'number') return;
|
||||
if (!existingHistHexes.has(hslToHex(hsl))) data.history.push(hsl);
|
||||
});
|
||||
if (data.history.length > 20) data.history = data.history.slice(0, 20);
|
||||
|
||||
Reference in New Issue
Block a user