-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Welcome message wrong link 33230 #33723
Merged
roryabraham
merged 10 commits into
Expensify:main
from
samilabud:welcome_message_wrong_link_33230
Jan 2, 2024
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c5a8392
Fixed Welcome message - Hmm its not here not displayed for wrong link
samilabud f630d73
Merge branch 'main' into welcome_message_wrong_link_33230
samilabud 12eefc2
Moved logic inside the condition that validates the report ID
samilabud 05c1cfb
Changed goback to using navigate to go home
samilabud 9025a25
Merge branch 'main' into welcome_message_wrong_link_33230
samilabud 6b1a002
Redirecting to same report page without reportActionID when it is not…
samilabud 80503c8
Additional lines removed
samilabud 513ee80
Confirming ready to open app after reportActionID validation
samilabud becc82a
Added suggestion to redirect
samilabud 36ef4ed
Fixed lint issue
samilabud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import {useEffect} from 'react'; | ||
import {OnyxCollection, OnyxEntry, withOnyx} from 'react-native-onyx'; | ||
import usePermissions from '@hooks/usePermissions'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import * as ReportUtils from '@libs/ReportUtils'; | ||
import * as App from '@userActions/App'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import ROUTES from '@src/ROUTES'; | ||
import type {Policy, Report, ReportMetadata} from '@src/types/onyx'; | ||
import type {ReportScreenWrapperProps} from './ReportScreenWrapper'; | ||
|
||
|
@@ -45,6 +47,14 @@ function ReportScreenIDSetter({route, reports, policies, navigation, isFirstTime | |
// Don't update if there is a reportID in the params already | ||
if (route?.params?.reportID) { | ||
App.confirmReadyToOpenApp(); | ||
|
||
const reportActionID = route?.params?.reportActionID; | ||
const regexValidReportActionID = new RegExp(/^\d*$/); | ||
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
Navigation.navigate(ROUTES.HOME); | ||
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. Lets navigate to the report without the reportActionID in this case instead. |
||
return; | ||
} | ||
|
||
return; | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there a reason for this line to be above this logic?
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.
Not really, additional lines were removed.