Filter modules (query & storage) without methods (#1311)
This commit is contained in:
parent
2ad6ea4a67
commit
51e188d4f6
@ -10,7 +10,7 @@ import ApiPromise from '@polkadot/api/promise';
|
||||
export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions {
|
||||
const section = api.tx[sectionName];
|
||||
|
||||
if (!section) {
|
||||
if (!section || Object.keys(section).length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ export default function createOptions (api: ApiPromise): DropdownOptions {
|
||||
return Object
|
||||
.keys(api.tx)
|
||||
.sort()
|
||||
.filter((name) => Object.keys(api.tx[name]).length)
|
||||
.map((name) => ({
|
||||
text: name,
|
||||
value: name
|
||||
|
||||
@ -11,7 +11,7 @@ import ApiPromise from '@polkadot/api/promise';
|
||||
export default function createOptions (api: ApiPromise, sectionName: string): DropdownOptions {
|
||||
const section = api.query[sectionName];
|
||||
|
||||
if (!section) {
|
||||
if (!section || Object.keys(section).length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ export default function createOptions (api: ApiPromise): DropdownOptions {
|
||||
return Object
|
||||
.keys(api.query)
|
||||
.sort()
|
||||
.filter((name) => Object.keys(api.query[name]).length)
|
||||
.map((name) => ({
|
||||
text: name,
|
||||
value: name
|
||||
|
||||
Loading…
Reference in New Issue
Block a user