mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-11-05 10:21:09 +00:00
Bump deps, small cleanups (#15)
This commit is contained in:
1 parent
48400b6d80
commit
4a89bc4204
5 files changed
+53
-44
No files matched your search
@@ -35,17 +35,13 @@ class KeyringOption implements KeyringOptionInstance {
|
||||
this.addAccounts(keyring, options);
|
||||
this.addAddresses(keyring, options);
|
||||
|
||||
options.address = ([] as KeyringSectionOptions).concat(
|
||||
options.address.length ? [ this.createOptionHeader('Addresses') ] : [],
|
||||
options.address,
|
||||
options.recent.length ? [ this.createOptionHeader('Recent') ] : [],
|
||||
options.recent
|
||||
options.address = this.linkItems(
|
||||
{ header: 'Addresses', options: options.address },
|
||||
{ header: 'Recent', options: options.recent }
|
||||
);
|
||||
options.account = ([] as KeyringSectionOptions).concat(
|
||||
options.account.length ? [ this.createOptionHeader('Accounts') ] : [],
|
||||
options.account,
|
||||
options.testing.length ? [ this.createOptionHeader('Development') ] : [],
|
||||
options.testing
|
||||
options.account = this.linkItems(
|
||||
{ header: 'Accounts', options: options.account },
|
||||
{ header: 'Development', options: options.testing }
|
||||
);
|
||||
|
||||
options.all = ([] as KeyringSectionOptions).concat(
|
||||
@@ -59,6 +55,17 @@ class KeyringOption implements KeyringOptionInstance {
|
||||
hasCalledInitOptions = true;
|
||||
}
|
||||
|
||||
private linkItems (...items: Array<{ header: string, options: KeyringSectionOptions }>) {
|
||||
return items.reduce((result, { header, options }) => {
|
||||
return result.concat(
|
||||
options.length
|
||||
? [this.createOptionHeader(header)]
|
||||
: [],
|
||||
options
|
||||
);
|
||||
}, [] as KeyringSectionOptions);
|
||||
}
|
||||
|
||||
private addAccounts (keyring: KeyringStruct, options: KeyringOptions): void {
|
||||
const available = keyring.accounts.subject.getValue();
|
||||
|
||||
|
||||
Reference in new issue
Block a user