Skip to content

Commit

Permalink
Merge pull request #55020 from nkdengineer/fix/54975
Browse files Browse the repository at this point in the history
Fix the start group button moves up

(cherry picked from commit 5f4df80)

(CP triggered by tgolen)
  • Loading branch information
tgolen authored and OSBotify committed Jan 9, 2025
1 parent 11b9596 commit 94c68dc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pages/NewChatPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import isEmpty from 'lodash/isEmpty';
import reject from 'lodash/reject';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {Keyboard} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import Button from '@components/Button';
import ImportedStateIndicator from '@components/ImportedStateIndicator';
Expand Down Expand Up @@ -230,7 +231,7 @@ function NewChatPage() {
if (isOptionInList) {
newSelectedOptions = reject(selectedOptions, (selectedOption) => selectedOption.login === option.login);
} else {
newSelectedOptions = [...selectedOptions, {...option, isSelected: true, selected: true, reportID: option.reportID ?? '-1'}];
newSelectedOptions = [...selectedOptions, {...option, isSelected: true, selected: true, reportID: option.reportID ?? `${CONST.DEFAULT_NUMBER_ID}`}];
}

selectionListRef?.current?.clearInputAfterSelect?.();
Expand Down Expand Up @@ -272,9 +273,13 @@ function NewChatPage() {
if (!personalData || !personalData.login || !personalData.accountID) {
return;
}
const selectedParticipants: SelectedParticipant[] = selectedOptions.map((option: OptionData) => ({login: option.login ?? '', accountID: option.accountID ?? -1}));
const selectedParticipants: SelectedParticipant[] = selectedOptions.map((option: OptionData) => ({
login: option.login ?? CONST.EMPTY_STRING,
accountID: option.accountID ?? CONST.DEFAULT_NUMBER_ID,
}));
const logins = [...selectedParticipants, {login: personalData.login, accountID: personalData.accountID}];
Report.setGroupDraft({participants: logins});
Keyboard.dismiss();
Navigation.navigate(ROUTES.NEW_CHAT_CONFIRM);
}, [selectedOptions, personalData]);
const {isDismissed} = useDismissedReferralBanners({referralContentType: CONST.REFERRAL_PROGRAM.CONTENT_TYPES.START_CHAT});
Expand Down

0 comments on commit 94c68dc

Please sign in to comment.