Commit d07368c6c8db32eb5d861492e9cee84968b76824

Authored by other
1 parent 72a5cfca

fix data.js

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
src/components/color-picker/utils.js
@@ -30,7 +30,7 @@ function getColor(data, colorData) { @@ -30,7 +30,7 @@ function getColor(data, colorData) {
30 } 30 }
31 31
32 export function changeColor(data, oldHue) { 32 export function changeColor(data, oldHue) {
33 - const colorData = data === '' ? '#2d8cf0' : data; 33 + const colorData = data === '' ? '#2d8cf0' : (data || '');
34 const color = getColor(data, colorData); 34 const color = getColor(data, colorData);
35 const hsl = color.toHsl(); 35 const hsl = color.toHsl();
36 const hsv = color.toHsv(); 36 const hsv = color.toHsv();
@@ -115,4 +115,4 @@ export function simpleCheckForValidColor(data) { @@ -115,4 +115,4 @@ export function simpleCheckForValidColor(data) {
115 const results = keysToCheck.reduce(checkIteratee.bind(null, data), {checked: 0, passed: 0}); 115 const results = keysToCheck.reduce(checkIteratee.bind(null, data), {checked: 0, passed: 0});
116 116
117 return results.checked === results.passed ? data : undefined; 117 return results.checked === results.passed ? data : undefined;
118 -} 118 -}
  119 +}
119 \ No newline at end of file 120 \ No newline at end of file