Skip to content

Commit

Permalink
fix: displayName regex
Browse files Browse the repository at this point in the history
  • Loading branch information
nikk15 committed Jun 21, 2023
1 parent 680d6db commit d64ce1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/name-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ AFRAME.registerComponent("name-tag", {
this.pronounsText.el.addEventListener("text-updated", () => this.updateNametagWidth(), {
once: true
});
if (this.pronouns.length > DISPLAY_NAME_LENGTH) {
if (this.pronouns && this.pronouns.length > DISPLAY_NAME_LENGTH) {
this.pronouns = this.pronouns.slice(0, DISPLAY_NAME_LENGTH).concat("...");
}
this.pronounsText.el.setAttribute("text", {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const SCHEMA = {
type: "object",
additionalProperties: false,
properties: {
displayName: { type: "string", pattern: "^[A-Za-z0-9_~ -]{3,32}$" },
displayName: { type: "string", pattern: "^(?:[A-Z]|[a-z]|[0-9]|[_~\\-]|\\s){3,32}$" },
avatarId: { type: "string" },
pronouns: { type: "string", pattern: "^[a-zA-Z///a-zA-Z]{2,32}$" },
// personalAvatarId is obsolete, but we need it here for backwards compatibility.
Expand Down

0 comments on commit d64ce1c

Please sign in to comment.