Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
parity-signer
Commits
78a1b5d6
Unverified
Commit
78a1b5d6
authored
Apr 30, 2020
by
Hanwen Cheng
Committed by
GitHub
Apr 30, 2020
Browse files
fix: prevent back on network choser android (#601)
* rebase on master * use iphone 11 for e2e * update os version
parent
23cc5f65
Pipeline
#90575
failed with stages
in 5 minutes and 41 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
78a1b5d6
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
"build"
:
"yarn xcbuild:githubActions"
,
"build"
:
"yarn xcbuild:githubActions"
,
"type"
:
"ios.simulator"
,
"type"
:
"ios.simulator"
,
"device"
:
{
"device"
:
{
"os"
:
"iOS 13.
3
"
,
"os"
:
"iOS 13.
4
"
,
"type"
:
"iPhone 8"
"type"
:
"iPhone 8"
}
}
},
},
...
...
src/modules/main/components/NetworkSelector.tsx
View file @
78a1b5d6
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
{
ScrollView
}
from
'
react-native
'
;
import
{
BackHandler
,
ScrollView
}
from
'
react-native
'
;
import
{
useFocusEffect
}
from
'
@react-navigation/native
'
;
import
{
NetworkCard
}
from
'
components/AccountCard
'
;
import
{
NetworkCard
}
from
'
components/AccountCard
'
;
import
{
SafeAreaViewContainer
}
from
'
components/SafeAreaContainer
'
;
import
{
SafeAreaViewContainer
}
from
'
components/SafeAreaContainer
'
;
...
@@ -68,6 +69,25 @@ export default function NetworkSelector({
...
@@ -68,6 +69,25 @@ export default function NetworkSelector({
const
{
identities
,
currentIdentity
}
=
accounts
.
state
;
const
{
identities
,
currentIdentity
}
=
accounts
.
state
;
const
seedRefHooks
=
useSeedRef
(
currentIdentity
!
.
encryptedSeed
);
const
seedRefHooks
=
useSeedRef
(
currentIdentity
!
.
encryptedSeed
);
// catch android back button and prevent exiting the app
useFocusEffect
(
React
.
useCallback
(():
any
=>
{
const
handleBackButton
=
():
boolean
=>
{
if
(
shouldShowMoreNetworks
)
{
setShouldShowMoreNetworks
(
false
);
return
true
;
}
else
{
return
false
;
}
};
const
backHandler
=
BackHandler
.
addEventListener
(
'
hardwareBackPress
'
,
handleBackButton
);
return
():
void
=>
backHandler
.
remove
();
},
[
shouldShowMoreNetworks
])
);
const
sortNetworkKeys
=
(
const
sortNetworkKeys
=
(
[,
params1
]:
[
any
,
NetworkParams
],
[,
params1
]:
[
any
,
NetworkParams
],
[,
params2
]:
[
any
,
NetworkParams
]
[,
params2
]:
[
any
,
NetworkParams
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment