fix: regex -> startsWith

This commit is contained in:
Tom Moor
2020-05-31 16:43:51 -07:00
parent 133cb56cca
commit f2eb395e8d

View File

@@ -53,9 +53,7 @@ class DocumentEditor extends React.Component<Props> {
render() {
const { document, title, onChangeTitle, isDraft, readOnly } = this.props;
const { emoji } = parseTitle(title);
const startsWithEmojiAndSpace = !!(
emoji && title.match(new RegExp(`^${emoji}\\s`))
);
const startsWithEmojiAndSpace = !!(emoji && title.startsWith(`${emoji} `));
return (
<Flex auto column>