Merge pull request #1115 from Luis-Fernando-Molina/develop

Contribution: BUG FIXED when deleting Votes Distribution nodes
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-06-08 15:09:19 -04:00
commit bdbfcc817c
1 file changed
+4 -1
@@ -159,6 +159,7 @@ function newGovernanceFunctionLibraryVotes() {
case 'node': {
if (node.type === 'User Profile' && property.name === "votesDistribution") {
let childNode = node[property.name]
if (childNode === undefined) { continue }
let percentage = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
if (percentage !== undefined && isNaN(percentage) !== true) {
totalPercentage = totalPercentage + percentage
@@ -171,9 +172,9 @@ function newGovernanceFunctionLibraryVotes() {
case 'array': {
let propertyArray = node[property.name]
if (propertyArray !== undefined) {
for (let m = 0; m < propertyArray.length; m++) {
let childNode = propertyArray[m]
if (childNode === undefined) { continue }
let percentage = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
if (percentage !== undefined && isNaN(percentage) !== true) {
totalPercentage = totalPercentage + percentage
@@ -206,6 +207,7 @@ function newGovernanceFunctionLibraryVotes() {
case 'node': {
if (node.type === 'User Profile' && property.name === "votesDistribution") {
let childNode = node[property.name]
if (childNode === undefined) { continue }
let percentage = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
if (percentage === undefined || isNaN(percentage) === true) {
percentage = defaultPercentage
@@ -219,6 +221,7 @@ function newGovernanceFunctionLibraryVotes() {
if (propertyArray !== undefined) {
for (let m = 0; m < propertyArray.length; m++) {
let childNode = propertyArray[m]
if (childNode === undefined) { continue }
let percentage = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(childNode.payload, 'percentage')
if (percentage === undefined || isNaN(percentage) === true) {
percentage = defaultPercentage