From 006b9650fb40c7351830d05e96fcf2e5410f1286 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 10 Jan 2025 00:22:10 +0700 Subject: [PATCH 1/3] Fix the start group button moves up --- src/pages/NewChatPage.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index 65aa253ff09d..6a4c67aaf5cc 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -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'; @@ -275,6 +276,7 @@ function NewChatPage() { const selectedParticipants: SelectedParticipant[] = selectedOptions.map((option: OptionData) => ({login: option.login ?? '', accountID: option.accountID ?? -1})); 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}); From 7850ce0227cfb98511af1e5ecf3362010d85fe48 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 10 Jan 2025 01:04:16 +0700 Subject: [PATCH 2/3] fix lint error --- src/pages/NewChatPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index 6a4c67aaf5cc..5c7e81a22ce3 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -231,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.EMPTY_STRING}]; } selectionListRef?.current?.clearInputAfterSelect?.(); @@ -273,7 +273,10 @@ 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(); From 7f60aed9c8fa45aa6057862b5c76164fb4580fe5 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 10 Jan 2025 01:40:18 +0700 Subject: [PATCH 3/3] change to default number id --- src/pages/NewChatPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index 5c7e81a22ce3..e513ba7b571d 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -231,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 ?? CONST.EMPTY_STRING}]; + newSelectedOptions = [...selectedOptions, {...option, isSelected: true, selected: true, reportID: option.reportID ?? `${CONST.DEFAULT_NUMBER_ID}`}]; } selectionListRef?.current?.clearInputAfterSelect?.();