Skip to content
GitLab
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
253c7fd3
Unverified
Commit
253c7fd3
authored
Jan 03, 2020
by
Hanwen Cheng
Committed by
GitHub
Jan 03, 2020
Browse files
fix: navigation after path deletion (#514)
parent
962aa12b
Pipeline
#73277
passed with stages
in 16 minutes and 32 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/screens/PathDetails.js
View file @
253c7fd3
...
@@ -30,6 +30,7 @@ import {
...
@@ -30,6 +30,7 @@ import {
getIdentityName
,
getIdentityName
,
getNetworkKeyByPath
,
getNetworkKeyByPath
,
getPathName
,
getPathName
,
getPathsWithSubstrateNetwork
,
isSubstratePath
isSubstratePath
}
from
'
../util/identitiesUtils
'
;
}
from
'
../util/identitiesUtils
'
;
import
{
defaultNetworkKey
,
UnknownNetworkKeys
}
from
'
../constants
'
;
import
{
defaultNetworkKey
,
UnknownNetworkKeys
}
from
'
../constants
'
;
...
@@ -61,8 +62,11 @@ export function PathDetailsView({ accounts, navigation, path, networkKey }) {
...
@@ -61,8 +62,11 @@ export function PathDetailsView({ accounts, navigation, path, networkKey }) {
alertDeleteAccount
(
'
this key pairs
'
,
async
()
=>
{
alertDeleteAccount
(
'
this key pairs
'
,
async
()
=>
{
await
unlockSeedPhrase
(
navigation
);
await
unlockSeedPhrase
(
navigation
);
const
deleteSucceed
=
await
accounts
.
deletePath
(
path
);
const
deleteSucceed
=
await
accounts
.
deletePath
(
path
);
const
paths
=
Array
.
from
(
accounts
.
state
.
currentIdentity
.
meta
.
keys
());
const
listedPaths
=
getPathsWithSubstrateNetwork
(
paths
,
networkKey
);
const
hasOtherPaths
=
listedPaths
.
length
>
0
;
if
(
deleteSucceed
)
{
if
(
deleteSucceed
)
{
isSubstratePath
(
path
)
&&
!
isRootPath
isSubstratePath
(
path
)
&&
!
isRootPath
&&
hasOtherPaths
?
navigateToPathsList
(
navigation
,
networkKey
)
?
navigateToPathsList
(
navigation
,
networkKey
)
:
navigation
.
navigate
(
'
AccountNetworkChooser
'
);
:
navigation
.
navigate
(
'
AccountNetworkChooser
'
);
}
else
{
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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