Backwards compatibility for identityOf (#10570)
* Backwards compatibility for identityOf * Fix null check * nit
This commit is contained in:
parent
6b16b9383d
commit
c615b4354a
@ -35,10 +35,18 @@ const JUDGEMENT_ENUM = [
|
||||
];
|
||||
|
||||
const OPT_ID = {
|
||||
transform: (optId: Option<ITuple<[PalletIdentityRegistration, Option<Bytes>]>>): HexString | null =>
|
||||
optId.isSome
|
||||
? optId.unwrap()[0].info.hash.toHex()
|
||||
: null
|
||||
transform: (optId: Option<ITuple<[PalletIdentityRegistration, Option<Bytes>]>>): HexString | null => {
|
||||
const id = optId.isSome
|
||||
? optId.unwrap()
|
||||
: null;
|
||||
|
||||
// Backwards compatibility - https://github.com/polkadot-js/apps/issues/10493
|
||||
return !id
|
||||
? null
|
||||
: Array.isArray(id)
|
||||
? id[0].info.hash.toHex()
|
||||
: (id as unknown as PalletIdentityRegistration).info.hash.toHex();
|
||||
}
|
||||
};
|
||||
|
||||
function RegistrarJudgement ({ address, registrars, toggleJudgement }: Props): React.ReactElement<Props> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user