Taichi Masuyama 4 лет назад
Родитель
Сommit
d433106dee

+ 3 - 3
packages/app/src/components/Admin/SlackIntegration/ManageCommandsProcess.jsx

@@ -71,10 +71,10 @@ const ManageCommandsProcess = ({
   const updatePermittedChannelsForEachCommand = (e) => {
     const commandName = e.target.name;
     const allowedChannelsString = e.target.value;
-    // remove all whitespace
-    const spaceRemovedAllowedChannelsString = allowedChannelsString.replace(/\s+/g, '');
     // string to array
-    const allowedChannelsArray = spaceRemovedAllowedChannelsString.split(',');
+    const allowedChannelsArray = allowedChannelsString.split(',');
+    // trim whitespace from all elements
+    const trimedAllowedChannelsArray = allowedChannelsArray.map(channelName => channelName.trim());
     setPermittedChannelsForEachCommand((prevState) => {
       const channelsObject = prevState.channelsObject;
       channelsObject[commandName] = allowedChannelsArray;