mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-04-22 02:08:03 +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.addAddresses(keyring, options);
|
||||
|
||||
options.address = this.linkItems(
|
||||
{ header: 'Addresses', options: options.address },
|
||||
{ header: 'Recent', options: options.recent }
|
||||
);
|
||||
options.account = this.linkItems(
|
||||
{ header: 'Accounts', options: options.account },
|
||||
{ header: 'Development', options: options.testing }
|
||||
);
|
||||
options.address = this.linkItems({
|
||||
'Addresses': options.address,
|
||||
'Recent': options.recent
|
||||
});
|
||||
options.account = this.linkItems({
|
||||
'Accounts': options.account,
|
||||
'Development': options.testing
|
||||
});
|
||||
|
||||
options.all = ([] as KeyringSectionOptions).concat(
|
||||
options.account,
|
||||
@@ -55,8 +55,10 @@ class KeyringOption implements KeyringOptionInstance {
|
||||
hasCalledInitOptions = true;
|
||||
}
|
||||
|
||||
private linkItems (...items: Array<{ header: string, options: KeyringSectionOptions }>) {
|
||||
return items.reduce((result, { header, options }) => {
|
||||
private linkItems (items: { [index: string]: KeyringSectionOptions }) {
|
||||
return Object.keys(items).reduce((result, header) => {
|
||||
const options = items[header];
|
||||
|
||||
return result.concat(
|
||||
options.length
|
||||
? [this.createOptionHeader(header)]
|
||||
|
||||
Reference in New Issue
Block a user