-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix: Address bar URL is not updated after login or landing on root #2346
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
d1a2aa5
ceac113
0c53948
d47683e
0df407f
5311e74
afd5a06
b6872ae
e6ef81f
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 |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ import HeaderView from './HeaderView'; | |
| import Navigation from '../../libs/Navigation/Navigation'; | ||
| import ROUTES from '../../ROUTES'; | ||
| import FullScreenLoadingIndicator from '../../components/FullscreenLoadingIndicator'; | ||
| import {updateCurrentlyViewedReportID} from '../../libs/actions/Report'; | ||
|
|
||
| const propTypes = { | ||
| /* Navigation route context info provided by react navigation */ | ||
|
|
@@ -37,6 +38,7 @@ class ReportScreen extends React.Component { | |
|
|
||
| if (reportChanged) { | ||
| this.prepareTransition(); | ||
| this.storeCurrentlyViewedReport(); | ||
|
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. This replaces the logic here: The
Contributor
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. This change makes sense to me. I don't see how it's different from what we had before (maybe a bit cleaner). Was there any other motivation for the change or just cleaning stuff up?
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. Primarily clean up, it should still work the same as before. I can revert this you think it might cause some issue down the road |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -73,6 +75,14 @@ class ReportScreen extends React.Component { | |
| this.loadingTimerId = setTimeout(() => this.setState({isLoading: false}), 300); | ||
| } | ||
|
|
||
| /** | ||
| * Persists the currently viewed report id | ||
| */ | ||
| storeCurrentlyViewedReport() { | ||
|
Contributor
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. All our components methods must have a method doc even if they don't take params or return anything.
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.
This is a class method and I'll just be adding this as a description: "Persists the currently viewed report id". I could extend it to "...with Onyx" but this is just an implementation detail Anyway this is not the first time, someone would bring up func/method documentation. In fact it is always the case that I should add documentation so you might consider updating the guide - I would have just always added documentation if I hadn't read the above in the style guide.
Contributor
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. Thanks for calling that out. I will update it to be more clear. |
||
| const reportID = this.getReportID(); | ||
| updateCurrentlyViewedReportID(reportID); | ||
kidroca marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| render() { | ||
| return ( | ||
| <ScreenWrapper style={[styles.appContent, styles.flex1]}> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.