From 604b450b5d6da9c1136898cdd810ded63834db37 Mon Sep 17 00:00:00 2001 From: adroitwhiz Date: Tue, 14 Apr 2020 16:12:29 -0400 Subject: [PATCH] Simplify fill-color-2 reducer logic why my brain hurt??? --- src/reducers/fill-color-2.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/reducers/fill-color-2.js b/src/reducers/fill-color-2.js index 5fe16d5a..c655123e 100644 --- a/src/reducers/fill-color-2.js +++ b/src/reducers/fill-color-2.js @@ -24,13 +24,12 @@ const reducer = function (state, action) { return state; } const colors = getColorsFromSelection(action.selectedItems); - if (colors.gradientType === GradientTypes.SOLID) { - // Gradient type may be solid when multiple gradient types are selected. - // In this case, changing the first color should not change the second color. - if (colors.fillColor2 === MIXED) return MIXED; - return state; + // Gradient type may be solid when multiple gradient types are selected. + // In this case, changing the first color should not change the second color. + if (colors.gradientType !== GradientTypes.SOLID || colors.fillColor2 === MIXED) { + return colors.fillColor2; } - return colors.fillColor2; + return state; } case CLEAR_GRADIENT: return null;