Unverified Commit e5f959a9 authored by Hanwen Cheng's avatar Hanwen Cheng Committed by GitHub
Browse files

fix: redirection for account with custom path (#544)

parent 8ef57b15
Pipeline #78208 failed with stages
in 1 minute and 56 seconds
......@@ -28,6 +28,7 @@ import QrView from '../components/QrView';
import {
getAddressWithPath,
getNetworkKey,
getNetworkKeyByPath,
getPathName,
getPathsWithSubstrateNetwork,
isSubstratePath
......@@ -61,11 +62,15 @@ export function PathDetailsView({ accounts, navigation, path, networkKey }) {
await unlockSeedPhrase(navigation);
const deleteSucceed = await accounts.deletePath(path);
const paths = Array.from(accounts.state.currentIdentity.meta.keys());
const listedPaths = getPathsWithSubstrateNetwork(paths, networkKey);
const pathIndicatedNetworkKey = getNetworkKeyByPath(path);
const listedPaths = getPathsWithSubstrateNetwork(
paths,
pathIndicatedNetworkKey
);
const hasOtherPaths = listedPaths.length > 0;
if (deleteSucceed) {
isSubstratePath(path) && hasOtherPaths
? navigateToPathsList(navigation, networkKey)
? navigateToPathsList(navigation, pathIndicatedNetworkKey)
: navigation.navigate('AccountNetworkChooser');
} else {
alertPathDeletionError();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment