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 { Input } from './Input';
|
||||||
import {
|
import {
|
||||||
CallLinkNameMaxByteLength,
|
CallLinkNameMaxByteLength,
|
||||||
|
CallLinkNameMaxLength,
|
||||||
type CallLinkType,
|
type CallLinkType,
|
||||||
} from '../types/CallLink';
|
} from '../types/CallLink';
|
||||||
import { getColorForCallLink } from '../util/getColorForCallLink';
|
import { getColorForCallLink } from '../util/getColorForCallLink';
|
||||||
|
@ -113,6 +114,7 @@ export function CallLinkAddNameModal({
|
||||||
onChange={handleNameInputChange}
|
onChange={handleNameInputChange}
|
||||||
moduleClassName="CallLinkAddNameModal__Input"
|
moduleClassName="CallLinkAddNameModal__Input"
|
||||||
maxByteCount={CallLinkNameMaxByteLength}
|
maxByteCount={CallLinkNameMaxByteLength}
|
||||||
|
maxLengthCount={CallLinkNameMaxLength}
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -21,6 +21,7 @@ export type CallLinkUpdateData = Readonly<{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const CallLinkNameMaxByteLength = 120;
|
export const CallLinkNameMaxByteLength = 120;
|
||||||
|
export const CallLinkNameMaxLength = 32;
|
||||||
|
|
||||||
export const callLinkNameSchema = z.string().refine(input => {
|
export const callLinkNameSchema = z.string().refine(input => {
|
||||||
return byteLength(input) <= 120;
|
return byteLength(input) <= 120;
|
||||||
|
|
Loading…
Reference in a new issue