-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix keyboard appears briefly when opening concierge page from a chat #37002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1719,7 +1719,7 @@ function updateWriteCapabilityAndNavigate(report: Report, newValue: WriteCapabil | |
| /** | ||
| * Navigates to the 1:1 report with Concierge | ||
| */ | ||
| function navigateToConciergeChat(shouldDismissModal = false, shouldPopCurrentScreen = false, checkIfCurrentPageActive = () => true) { | ||
| function navigateToConciergeChat(shouldDismissModal = false, checkIfCurrentPageActive = () => true) { | ||
| // If conciergeChatReportID contains a concierge report ID, we navigate to the concierge chat using the stored report ID. | ||
| // Otherwise, we would find the concierge chat and navigate to it. | ||
| if (!conciergeChatReportID) { | ||
|
|
@@ -1730,17 +1730,11 @@ function navigateToConciergeChat(shouldDismissModal = false, shouldPopCurrentScr | |
| if (!checkIfCurrentPageActive()) { | ||
| return; | ||
| } | ||
| if (shouldPopCurrentScreen && !shouldDismissModal) { | ||
| Navigation.goBack(); | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why I remove this? It's related to my comment above. I added this from the linked PR above. This is only being used in ConciergePage, but since we decided to use dismiss modal, this param is not needed anymore. |
||
| navigateToAndOpenReport([CONST.EMAIL.CONCIERGE], shouldDismissModal); | ||
| }); | ||
| } else if (shouldDismissModal) { | ||
| Navigation.dismissModal(conciergeChatReportID); | ||
| } else { | ||
| if (shouldPopCurrentScreen) { | ||
| Navigation.goBack(); | ||
| } | ||
| Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(conciergeChatReportID)); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,7 @@ function PurposeForUsingExpensifyModal() { | |
| } | ||
|
|
||
| Report.completeEngagementModal(message, choice); | ||
| Report.navigateToConciergeChat(false, true); | ||
| Report.navigateToConciergeChat(true); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing the param conflict
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, []); | ||
|
|
||
| const menuItems: MenuItemProps[] = useMemo( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ function ConnectBankAccount({reimbursementAccount, onBackButtonPress, account, p | |
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const handleNavigateToConciergeChat = () => Report.navigateToConciergeChat(false, true); | ||
| const handleNavigateToConciergeChat = () => Report.navigateToConciergeChat(true); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing the param conflict
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The param to dismiss the modal was added in bank account refactor. Still works fine Screen.Recording.2024-02-26.at.14.09.47.mov |
||
| const bankAccountState = reimbursementAccount.achData?.state ?? ''; | ||
|
|
||
| // If a user tries to navigate directly to the validate page we'll show them the EnableStep | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to use the alternative solution. Here is why:
I have another PR here that is related to the concierge page too. When working on the PR, I tried to smoothen the navigation by replacing GO BACK with REPLACE, just like what we want to do here, but found out that it can open multiple consecutive concierge chats.
For example, when you have chat A and concierge chat.
[A, Concierge Chat]
Then, you open another concierge page.
[A, Concierge Chat, Concierge Page]
If we just use the REPLACE, we will have 2 concierge chats.
[A, Concierge Chat, Concierge Chat]
But if we use
dismissModal, it will check first whether the topmost report is the same as the target report. If it's the same, it will just pop the concierge page out, otherwise, it will replace the concierge page with the concierge chat.This will conflict with the PR I linked above, so we can wait a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting waiting for the other PR to be merged and deployed? Or do you think it's safe now to merge these changes now that the other PR has been merged?