fix: regex -> startsWith

This commit is contained in:
Tom Moor committed 2020-05-31 16:43:51 -07:00
1 parent 133cb56cca
commit f2eb395e8d
1 file changed
+1 -3
+1 -3
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>