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

chore: add name into account qr code (#538)

* chore: add name into account qr code

* chore: rename

* merge master
parent 5700a4dd
Pipeline #77806 failed with stages
in 1 minute and 44 seconds
......@@ -110,7 +110,9 @@ function AccountDetails({ accounts, navigation }) {
/>
<View>
{protocol !== NetworkProtocols.UNKNOWN ? (
<QrView data={selectedKey} />
<QrView
data={account.name ? `${selectedKey}:${account.name}` : selectedKey}
/>
) : (
<UnknownAccountWarning />
)}
......
......@@ -28,6 +28,7 @@ import QrView from '../components/QrView';
import {
getAddressWithPath,
getNetworkKey,
getPathName,
getPathsWithSubstrateNetwork,
isSubstratePath
} from '../util/identitiesUtils';
......@@ -44,6 +45,7 @@ import UnknownAccountWarning from '../components/UnknownAccountWarning';
export function PathDetailsView({ accounts, navigation, path, networkKey }) {
const { currentIdentity } = accounts.state;
const address = getAddressWithPath(path, currentIdentity);
const accountName = getPathName(path, currentIdentity);
if (!address) return null;
const isUnknownNetwork = networkKey === UnknownNetworkKeys.UNKNOWN;
const formattedNetworkKey = isUnknownNetwork ? defaultNetworkKey : networkKey;
......@@ -104,7 +106,7 @@ export function PathDetailsView({ accounts, navigation, path, networkKey }) {
</View>
<ScrollView>
<PathCard identity={currentIdentity} path={path} />
<QrView data={accountId} />
<QrView data={`${accountId}:${accountName}`} />
{isUnknownNetwork && <UnknownAccountWarning isPath />}
</ScrollView>
</View>
......
Supports Markdown
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