From 253dcf8b38c6ef2bec1a524db70e30ac7b1817c5 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 6 May 2020 19:44:56 +0300 Subject: Fix modifier key condition data (#506) * save transformed data for modifier key conditions * validate transformed input * fix regression * undo rename * refactor transformInput handling * don't overwrite value with null --- ext/bg/js/profile-conditions.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/bg/js/profile-conditions.js') diff --git a/ext/bg/js/profile-conditions.js b/ext/bg/js/profile-conditions.js index c0f5d3f5..32309c64 100644 --- a/ext/bg/js/profile-conditions.js +++ b/ext/bg/js/profile-conditions.js @@ -128,9 +128,9 @@ const profileConditionsDescriptor = { are: { name: 'are', placeholder: 'Press one or more modifier keys here', - defaultValue: '', + defaultValue: [], type: 'keyMulti', - transform: (optionValue) => optionValue + transformInput: (optionValue) => optionValue .split(' + ') .filter((v) => v.length > 0) .map((v) => _profileModifierNameToValue.get(v)), @@ -142,9 +142,9 @@ const profileConditionsDescriptor = { areNot: { name: 'are not', placeholder: 'Press one or more modifier keys here', - defaultValue: '', + defaultValue: [], type: 'keyMulti', - transform: (optionValue) => optionValue + transformInput: (optionValue) => optionValue .split(' + ') .filter((v) => v.length > 0) .map((v) => _profileModifierNameToValue.get(v)), -- cgit v1.2.3