diff --git a/src/containers/InteractiveMessage/InteractiveMessage.tsx b/src/containers/InteractiveMessage/InteractiveMessage.tsx index 6234d7607..81b66c183 100644 --- a/src/containers/InteractiveMessage/InteractiveMessage.tsx +++ b/src/containers/InteractiveMessage/InteractiveMessage.tsx @@ -20,7 +20,13 @@ import { EmojiInput } from 'components/UI/Form/EmojiInput/EmojiInput'; import { AutoComplete } from 'components/UI/Form/AutoComplete/AutoComplete'; import { Simulator } from 'components/simulator/Simulator'; import { LanguageBar } from 'components/UI/LanguageBar/LanguageBar'; -import { LIST, LOCATION_REQUEST, MEDIA_MESSAGE_TYPES, QUICK_REPLY } from 'common/constants'; +import { + LIST, + LOCATION_REQUEST, + MEDIA_MESSAGE_TYPES, + QUICK_REPLY, + VALID_URL_REGEX, +} from 'common/constants'; import { validateMedia } from 'common/utils'; import { Loading } from 'components/UI/Layout/Loading/Loading'; import { InteractiveOptions } from './InteractiveOptions/InteractiveOptions'; @@ -254,7 +260,10 @@ export const InteractiveMessage = () => { } if (isEditing && data.attachmentURL) { - setDynamicMedia(!isUrlValid); + const testForValidUrl = new RegExp(VALID_URL_REGEX, 'gi'); + if (!testForValidUrl.test(data.attachmentURL)) { + setDynamicMedia(true); + } } if (translationsVal) {