Skip to content

Commit

Permalink
Disallow unsetting colors
Browse files Browse the repository at this point in the history
Fixes #114
  • Loading branch information
ajlende committed Jul 28, 2020
1 parent 50a2d7f commit f0b061a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blocks/waves/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function Edit( { attributes, className, isSelected, setAttributes } ) {
{
label: __( 'Color 1', 'waves' ),
value: colors.color1,
onChange: ( color1 ) => {
onChange: ( color1 = colors.color1 ) => {
const previewImage = updatePreview( {
color1: parseColor( color1 ),
} );
Expand All @@ -253,7 +253,7 @@ function Edit( { attributes, className, isSelected, setAttributes } ) {
{
label: __( 'Color 2', 'waves' ),
value: colors.color2,
onChange: ( color2 ) => {
onChange: ( color2 = colors.color2 ) => {
const previewImage = updatePreview( {
color2: parseColor( color2 ),
} );
Expand All @@ -263,7 +263,7 @@ function Edit( { attributes, className, isSelected, setAttributes } ) {
{
label: __( 'Color 3', 'waves' ),
value: colors.color3,
onChange: ( color3 ) => {
onChange: ( color3 = colors.color3 ) => {
const previewImage = updatePreview( {
color3: parseColor( color3 ),
} );
Expand All @@ -273,7 +273,7 @@ function Edit( { attributes, className, isSelected, setAttributes } ) {
{
label: __( 'Color 4', 'waves' ),
value: colors.color4,
onChange: ( color4 ) => {
onChange: ( color4 = colors.color4 ) => {
const previewImage = updatePreview( {
color4: parseColor( color4 ),
} );
Expand Down

0 comments on commit f0b061a

Please sign in to comment.