Limit call link names to 32 characters
This commit is contained in:
parent
09bd95228d
commit
99f91b5f54
2 changed files with 3 additions and 0 deletions
|
@ -9,6 +9,7 @@ import { Avatar, AvatarSize } from './Avatar';
|
|||
import { Input } from './Input';
|
||||
import {
|
||||
CallLinkNameMaxByteLength,
|
||||
CallLinkNameMaxLength,
|
||||
type CallLinkType,
|
||||
} from '../types/CallLink';
|
||||
import { getColorForCallLink } from '../util/getColorForCallLink';
|
||||
|
@ -113,6 +114,7 @@ export function CallLinkAddNameModal({
|
|||
onChange={handleNameInputChange}
|
||||
moduleClassName="CallLinkAddNameModal__Input"
|
||||
maxByteCount={CallLinkNameMaxByteLength}
|
||||
maxLengthCount={CallLinkNameMaxLength}
|
||||
/>
|
||||
</form>
|
||||
</Modal>
|
||||
|
|
|
@ -21,6 +21,7 @@ export type CallLinkUpdateData = Readonly<{
|
|||
*/
|
||||
|
||||
export const CallLinkNameMaxByteLength = 120;
|
||||
export const CallLinkNameMaxLength = 32;
|
||||
|
||||
export const callLinkNameSchema = z.string().refine(input => {
|
||||
return byteLength(input) <= 120;
|
||||
|
|
Loading…
Reference in a new issue