mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-18 21:36:27 +01:00
Add messenger max length
This commit is contained in:
parent
5cf49daaf8
commit
13ac69a6b3
@ -19,7 +19,7 @@ export const FriendsRoomInviteView: FC<FriendsRoomInviteViewProps> = props =>
|
||||
<NitroCardHeaderView headerText={ LocalizeText('friendlist.invite.title') } onCloseClick={ onCloseClick } />
|
||||
<NitroCardContentView className="text-black">
|
||||
{ LocalizeText('friendlist.invite.summary', [ 'count' ], [ selectedFriendsIds.length.toString() ]) }
|
||||
<textarea className="form-control" value={ roomInviteMessage } onChange={ event => setRoomInviteMessage(event.target.value) }></textarea>
|
||||
<textarea className="form-control" value={ roomInviteMessage } maxLength={ 255 } onChange={ event => setRoomInviteMessage(event.target.value) }></textarea>
|
||||
<Text center className="bg-muted rounded p-1">{ LocalizeText('friendlist.invite.note') }</Text>
|
||||
<Flex gap={ 1 }>
|
||||
<Button fullWidth variant="success" disabled={ ((roomInviteMessage.length === 0) || (selectedFriendsIds.length === 0)) } onClick={ () => sendRoomInvite(roomInviteMessage) }>{ LocalizeText('friendlist.invite.send') }</Button>
|
||||
|
@ -62,9 +62,10 @@ export const FriendsListView: FC<{}> = props =>
|
||||
|
||||
const sendRoomInvite = (message: string) =>
|
||||
{
|
||||
if(selectedFriendsIds.length === 0 || !message || message.length === 0) return;
|
||||
if(!selectedFriendsIds.length || !message || !message.length || (message.length > 255)) return;
|
||||
|
||||
SendMessageComposer(new SendRoomInviteComposer(message, selectedFriendsIds));
|
||||
|
||||
setShowRoomInvite(false);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ const useMessengerState = () =>
|
||||
|
||||
const ownMessage = (senderId === GetSessionDataManager().userId);
|
||||
|
||||
if(ownMessage) SendMessageComposer(new SendMessageComposerPacket(thread.participant.id, messageText));
|
||||
if(ownMessage && (messageText.length <= 255)) SendMessageComposer(new SendMessageComposerPacket(thread.participant.id, messageText));
|
||||
|
||||
setMessageThreads(prevValue =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user