prevent an error upon pressing the back button on the splash screen #212
No reviewers
Labels
No labels
android: closed alpha
android: open beta
app-parity
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
creator
Epic
good first issue
hacktoberfest
help wanted
icebox
Invalid
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
product review
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-android#212
Loading…
Reference in a new issue
No description provided.
Delete branch "splash-screen-back"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One comment
@ -137,2 +137,4 @@
return true;
}
}
if (nav.routes[0].routeName === 'Main') {
nav.routes[0].routes[0].index > 0
what is
.index
?@ -137,2 +137,4 @@
return true;
}
}
if (nav.routes[0].routeName === 'Main') {
@seanyesmunt It's the index of the current active route in the navigation state. See https://reactnavigation.org/docs/en/stack-actions.html.
@ -137,3 +138,4 @@
}
}
if (nav.routes[0].routeName === 'Main') {
if (nav.routes[0].routes[0].routes[0].index > 0) {
This seems very volatile to changes, I'll take a closer look tomorrow.
@ -137,3 +138,4 @@
}
}
if (nav.routes[0].routeName === 'Main') {
if (nav.routes[0].routes[0].routes[0].index > 0) {
Yes, I agree. However, since we have a fixed navigation structure which is unlikely to change often, I think it's a passable solution until we can come up with a better approach. See
f8af04ba4b/app/src/component/AppNavigator.js (L129)
@ -137,3 +138,4 @@
}
}
if (nav.routes[0].routeName === 'Main') {
if (nav.routes[0].routes[0].routes[0].index > 0) {
Setting aside the specific code choices made here, I wanted to comment on the more general situation of how we handle shipping mediocre/bad temporary solutions (which is part of normal development and not something that has to be avoided 100%).
If we're writing code that we know is subpar pending another change or an issue, we should:
Coming back to this specific choice, if we must do things this way, it could make sense to hoist the declaration up to the top of the file to add clarity about it's existence.