diff --git a/webapp/channels/src/components/new_channel_modal/new_channel_modal.tsx b/webapp/channels/src/components/new_channel_modal/new_channel_modal.tsx index 67eaaa8a78..9052004e60 100644 --- a/webapp/channels/src/components/new_channel_modal/new_channel_modal.tsx +++ b/webapp/channels/src/components/new_channel_modal/new_channel_modal.tsx @@ -7,6 +7,7 @@ import {FormattedMessage, useIntl} from 'react-intl'; import {Tooltip} from 'react-bootstrap'; import classNames from 'classnames'; +import crypto from 'crypto'; import OverlayTrigger from 'components/overlay_trigger'; import GenericModal from 'components/generic_modal'; @@ -233,6 +234,9 @@ const NewChannelModal = () => { }; const handleOnDisplayNameBlur = () => { + if (displayName && !url) { + setURL(crypto.randomBytes(16).toString('hex')); + } if (!displayNameModified) { setDisplayNameModified(true); } @@ -270,7 +274,7 @@ const NewChannelModal = () => { e.stopPropagation(); }; - const canCreate = displayName && !displayNameError && url && !urlError && type && !purposeError && !serverError && canCreateFromPluggable; + const canCreate = displayName && !displayNameError && !urlError && type && !purposeError && !serverError && canCreateFromPluggable; const newBoardInfoIcon = (