Skip to content

fix(ui): PresenceIndicator initials computation breaks on empty name or consecutive spaces #413

@github-actions

Description

@github-actions

Summary

The initials computation in PresenceIndicator.tsx uses name.split(' ') which produces empty strings for consecutive spaces or an empty name. Accessing w[0] on an empty string returns undefined, causing the join() call to include literal "undefined" text in the initials.

Affected file

src/UILayer/web/src/components/shared/PresenceIndicator.tsx — line 28

Required fix

const initials = name
  .split(' ')
  .filter(Boolean)
  .map((w) => w[0])
  .join('')
  .slice(0, 2)
  .toUpperCase()

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions