mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-13 22:41:02 +00:00
Pass options as { header: options } (create) (#16)
* Pass options as { header: options } (create)
* Actually save... pass linting as a result
This commit is contained in:
@@ -35,14 +35,14 @@ class KeyringOption implements KeyringOptionInstance {
|
|||||||
this.addAccounts(keyring, options);
|
this.addAccounts(keyring, options);
|
||||||
this.addAddresses(keyring, options);
|
this.addAddresses(keyring, options);
|
||||||
|
|
||||||
options.address = this.linkItems(
|
options.address = this.linkItems({
|
||||||
{ header: 'Addresses', options: options.address },
|
'Addresses': options.address,
|
||||||
{ header: 'Recent', options: options.recent }
|
'Recent': options.recent
|
||||||
);
|
});
|
||||||
options.account = this.linkItems(
|
options.account = this.linkItems({
|
||||||
{ header: 'Accounts', options: options.account },
|
'Accounts': options.account,
|
||||||
{ header: 'Development', options: options.testing }
|
'Development': options.testing
|
||||||
);
|
});
|
||||||
|
|
||||||
options.all = ([] as KeyringSectionOptions).concat(
|
options.all = ([] as KeyringSectionOptions).concat(
|
||||||
options.account,
|
options.account,
|
||||||
@@ -55,8 +55,10 @@ class KeyringOption implements KeyringOptionInstance {
|
|||||||
hasCalledInitOptions = true;
|
hasCalledInitOptions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private linkItems (...items: Array<{ header: string, options: KeyringSectionOptions }>) {
|
private linkItems (items: { [index: string]: KeyringSectionOptions }) {
|
||||||
return items.reduce((result, { header, options }) => {
|
return Object.keys(items).reduce((result, header) => {
|
||||||
|
const options = items[header];
|
||||||
|
|
||||||
return result.concat(
|
return result.concat(
|
||||||
options.length
|
options.length
|
||||||
? [this.createOptionHeader(header)]
|
? [this.createOptionHeader(header)]
|
||||||
|
|||||||
Reference in New Issue
Block a user