1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

fixed empty title error

This commit is contained in:
Fedor Katurov 2020-04-08 15:39:28 +07:00
parent eade3efc7c
commit 8ad5576983
2 changed files with 5 additions and 2 deletions

View file

@ -11,7 +11,9 @@ type IProps = RouteComponentProps & {
};
const getTitleLetters = (title: string): string => {
const words = title.split(' ');
const words = (title && title.split(' ')) || [];
if (!words.length) return '';
return words.length > 1
? words