From ab864a86fdcc772f8bb0bb20a52d5d3a08374e95 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Wed, 19 Jan 2022 22:20:04 -0800 Subject: [PATCH] fix: File and emoji pickers are disabled by default (#3803) File and emoji pickers should be enabled by default. Fixes: #3560 Co-authored-by: Pranav Raj S Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> --- .../dashboard/store/modules/inboxes.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/javascript/dashboard/store/modules/inboxes.js b/app/javascript/dashboard/store/modules/inboxes.js index 83102ba97..e266887f7 100644 --- a/app/javascript/dashboard/store/modules/inboxes.js +++ b/app/javascript/dashboard/store/modules/inboxes.js @@ -12,13 +12,16 @@ const buildInboxData = inboxParams => { Object.keys(inboxProperties).forEach(key => { formData.append(key, inboxProperties[key]); }); - const { selectedFeatureFlags = [], ...channelParams } = channel; - if (selectedFeatureFlags.length) { - selectedFeatureFlags.forEach(featureFlag => { - formData.append(`channel[selected_feature_flags][]`, featureFlag); - }); - } else { - formData.append('channel[selected_feature_flags][]', ''); + const { selectedFeatureFlags, ...channelParams } = channel; + // selectedFeatureFlags needs to be empty when creating a website channel + if (selectedFeatureFlags) { + if (selectedFeatureFlags.length) { + selectedFeatureFlags.forEach(featureFlag => { + formData.append(`channel[selected_feature_flags][]`, featureFlag); + }); + } else { + formData.append('channel[selected_feature_flags][]', ''); + } } Object.keys(channelParams).forEach(key => { formData.append(`channel[${key}]`, channel[key]);