Skip to content

Commit

Permalink
Handle whitespace + no initial for anonymous
Browse files Browse the repository at this point in the history
  • Loading branch information
GuzzoD committed Jun 29, 2023
1 parent f11a1e2 commit d97c4cd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ export class TaskbarEditorComponent implements OnInit {
public getInitials(): string {
let initials: string = '';

if(this.currentEditor === 'anonymous') return '';

let splitted: string[] = this.currentEditor.split(' ');
for (let i = 0; i < splitted.length; i++) {
initials += splitted[i].charAt(0) + '.';
const word = splitted[i].trim();
if (word !== '') {
initials += word.charAt(0) + '.';
}
}
return initials;
}
Expand Down

0 comments on commit d97c4cd

Please sign in to comment.