Skip to content

Commit

Permalink
Merge branch 'main' into release-2.55.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gewfy authored Jul 21, 2024
2 parents 3167a22 + 203b7f6 commit 78330bd
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import SessionMood from './SessionMood';
import AutoScrollView from '../../../../../lib/components/AutoScrollView/AutoScrollView';
import useLogSessionMood from '../hooks/useLogSessionMood';

const DISPLAY_NAME_MAX_LENGTH = 20;

const KeyboardWrapper = styled.KeyboardAvoidingView.attrs({
behavior: Platform.select<KeyboardAvoidingViewProps['behavior']>({
ios: 'position',
Expand Down Expand Up @@ -90,7 +92,7 @@ const InputWrapper = styled.View({
});

const StyledTextInput = styled(TextInput)({
flexGrow: 1,
flex: 1,
});

const Audio = styled(AudioIndicator)({
Expand Down Expand Up @@ -132,7 +134,9 @@ const HairCheck = () => {
const isFocused = useIsFocused();
const me = useLocalParticipant();
const user = useUser();
const [localUserName, setLocalUserName] = useState(user?.displayName ?? '');
const [localUserName, setLocalUserName] = useState(
user?.displayName?.slice(0, DISPLAY_NAME_MAX_LENGTH) ?? '',
);
const logSessionMetricEvent = useLiveSessionMetricEvents();
const {
checkAndPromptJoinPermissions,
Expand Down Expand Up @@ -257,7 +261,7 @@ const HairCheck = () => {
onSubmitEditing={joinPress}
autoCapitalize="words"
autoCorrect={false}
maxLength={20}
maxLength={DISPLAY_NAME_MAX_LENGTH}
defaultValue={localUserName}
placeholder={t('placeholder')}
/>
Expand Down

0 comments on commit 78330bd

Please sign in to comment.