Bug fix
This commit is contained in:
parent
af0ecf4a13
commit
1ebbf51bb4
24
index.html
24
index.html
@ -2852,17 +2852,23 @@
|
||||
}
|
||||
|
||||
function filterSmartContracts(options) {
|
||||
const { type, subType, dynamic = false } = options || {}
|
||||
let filteredSmartContracts = (floGlobals.smartContracts || [])
|
||||
.filter(sc => sc.status === 'active')
|
||||
const { type, subType, dynamic = false } = options || {};
|
||||
let filteredSmartContracts = floGlobals.smartContracts || [];
|
||||
if (type) {
|
||||
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.contractType === type)
|
||||
if (type === 'continuos-event' && dynamic)
|
||||
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.oracle_address)
|
||||
filteredSmartContracts = filteredSmartContracts.filter(sc => {
|
||||
if (type === 'external-trigger') {
|
||||
return sc.status !== 'active'; // only inactive contracts can be triggered externally
|
||||
} else if (type === 'continuos-event' && dynamic) {
|
||||
return sc.status === 'active' && sc.contractType === type && sc.oracle_address;
|
||||
} else {
|
||||
return sc.status === 'active' && sc.contractType === type;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (subType)
|
||||
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.contractSubType === subType)
|
||||
return filteredSmartContracts
|
||||
if (subType) {
|
||||
filteredSmartContracts = filteredSmartContracts.filter(sc => sc.contractSubType === subType);
|
||||
}
|
||||
return filteredSmartContracts;
|
||||
}
|
||||
|
||||
function handleSmartContractSelection(actionType) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user