diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 42ab553b46..f6dfe90735 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -59,7 +59,9 @@ const TYPING_USER_TIMEOUT = 10000, TYPING_SERVER_TIMEOUT = 30000; const ZWS_CODE = 8203; const ZWS = String.fromCharCode(ZWS_CODE); // zero width space -const ATROOMPILL_ENTITY_TYPE = 'ATROOMPILL'; +const ENTITY_TYPES = { + AT_ROOM_PILL = 'ATROOMPILL', +}; function stateToMarkdown(state) { return __stateToMarkdown(state) @@ -199,7 +201,7 @@ export default class MessageComposerInput extends React.Component { entityKey !== null && ( contentState.getEntity(entityKey).getType() === 'LINK' || - contentState.getEntity(entityKey).getType() === ATROOMPILL_ENTITY_TYPE + contentState.getEntity(entityKey).getType() === ENTITY_TYPES.AT_ROOM_PILL ) ); }, callback, @@ -221,7 +223,7 @@ export default class MessageComposerInput extends React.Component { const Pill = sdk.getComponent('elements.Pill'); const type = entityProps.contentState.getEntity(entityProps.entityKey).getType(); const {url} = entityProps.contentState.getEntity(entityProps.entityKey).getData(); - if (type === ATROOMPILL_ENTITY_TYPE) { + if (type === ENTITY_TYPES.AT_ROOM_PILL) { return