From 90cc1483831ffbd421eb1af3fb68d7d6403842d4 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sun, 29 Nov 2020 16:08:39 +0100 Subject: [PATCH] Correct hasIdentity parentId extraction (#2884) --- packages/api-derive/src/accounts/identity.ts | 7 +++---- packages/api-derive/src/accounts/types.ts | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/api-derive/src/accounts/identity.ts b/packages/api-derive/src/accounts/identity.ts index 18a90956e2..cb4235b74e 100644 --- a/packages/api-derive/src/accounts/identity.ts +++ b/packages/api-derive/src/accounts/identity.ts @@ -107,12 +107,11 @@ export function hasIdentity (instanceId: string, api: ApiInterfaceRx): (accountI api.derive.accounts._identityBase(accountId).pipe( map(([identityOfOpt, superOfOpt]: [Option | undefined, Option> | undefined]): DeriveHasIdentity => { const parentId = superOfOpt && superOfOpt.isSome - ? superOfOpt.unwrap().toString() + ? superOfOpt.unwrap()[0].toString() : null; - const hasParent = !!parentId; - const hasIdentity = hasParent || !!(identityOfOpt && identityOfOpt.isSome); + const hasIdentity = !!parentId || !!(identityOfOpt && identityOfOpt.isSome); - return { hasIdentity, hasParent, parentId }; + return { hasIdentity, parentId }; }) ) ); diff --git a/packages/api-derive/src/accounts/types.ts b/packages/api-derive/src/accounts/types.ts index 154e1f44ec..da58449018 100644 --- a/packages/api-derive/src/accounts/types.ts +++ b/packages/api-derive/src/accounts/types.ts @@ -38,6 +38,5 @@ export interface DeriveAccountInfo { export interface DeriveHasIdentity { hasIdentity: boolean; - hasParent: boolean; parentId: string | null; }