Skip to content

Commit

Permalink
fix #867
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jan 24, 2025
1 parent 3fbee35 commit a2a5eee
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions server/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1249,11 +1249,9 @@ export class Room {
return;
}
}
if (vanity) {
if (vanity.length > 100) {
socket.emit('errorMessage', 'Custom URL too long');
return;
}
if (vanity && vanity.length > 100) {
socket.emit('errorMessage', 'Custom URL too long');
return;
}
if (roomTitle && roomTitle.length > 50) {
socket.emit('errorMessage', 'Room title too long');
Expand Down Expand Up @@ -1281,7 +1279,8 @@ export class Room {
};
if (isSubscriber) {
// user must be sub to set certain properties
roomObj.vanity = vanity;
// If empty vanity, reset to null
roomObj.vanity = vanity ?? null;
roomObj.roomTitle = roomTitle;
roomObj.roomDescription = roomDescription;
roomObj.roomTitleColor = roomTitleColor;
Expand Down

0 comments on commit a2a5eee

Please sign in to comment.