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

Contribution: GOvernance Bug Fix at request tos BSC SCAN breaking rate limit
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-06-17 13:53:47 -04:00
commit 46d401ea1a
4 files changed
+27 -26

No files matched your search

@@ -325,7 +325,7 @@ function newCircularMenuItem() {
/* The first click ask for confirmation. */
if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET) {
setStatus(thisObject.confirmationLabel, UI_COLOR.GOLDEN_ORANGE, 100, STATUS_WAITING_CONFIRMATION)
setStatus(thisObject.confirmationLabel, UI_COLOR.GOLDEN_ORANGE, 250, STATUS_WAITING_CONFIRMATION)
return
}
/* A Click during confirmation executes the pre-defined action. */
@@ -24,7 +24,6 @@ function newGovernanceFunctionLibraryProfileConstructor() {
}
createNewAccount()
signUserProfileData()
function createNewAccount() {
let params = {
@@ -52,15 +51,11 @@ function newGovernanceFunctionLibraryProfileConstructor() {
return
}
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(node.payload, 'address', response.address)
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(node.payload, 'privateKey', response.privateKey)
signUserProfileData(response.address, response.privateKey)
}
}
function signUserProfileData() {
let privateKey = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'privateKey')
if (privateKey === undefined || privateKey === "") { return }
function signUserProfileData(address, privateKey) {
let request = {
url: 'WEB3',
@@ -89,6 +84,8 @@ function newGovernanceFunctionLibraryProfileConstructor() {
return
}
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(node.payload.referenceParent.payload, 'signature', response.signature)
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(node.payload, 'address', address)
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(node.payload, 'privateKey', privateKey)
node.payload.uiObject.setInfoMessage("Profile Account has been successfully created.")
}
@@ -14,7 +14,8 @@ function newGovernanceUserProfileSpace() {
thisObject.container.initialize(MODULE_NAME)
thisObject.container.isDraggeable = false
waitingForResponses = 0
let waitingForResponses = 0
let timer = 0
return thisObject
@@ -47,7 +48,6 @@ function newGovernanceUserProfileSpace() {
We will get all the user Profiles tokens from the blockchain, making a call
every 5 seconds so as not to exceed the rate limit.
*/
let timer = 0
for (let i = 0; i < userProfiles.length; i++) {
let userProfile = userProfiles[i]
if (userProfile.payload === undefined) { continue }
+20 -16
View File
@@ -107,27 +107,31 @@ function newUniqueId() {
}
function splitTextIntoPhrases(text, wordsPerLine) {
let splittedLabel = text.split(' ')
let phrases = []
let phrase = ''
let wordCount = 0
for (let i = 0; i < splittedLabel.length; i++) {
phrase = phrase + splittedLabel[i]
wordCount++
try {
let splittedLabel = text.split(' ')
let phrases = []
let phrase = ''
let wordCount = 0
for (let i = 0; i < splittedLabel.length; i++) {
phrase = phrase + splittedLabel[i]
wordCount++
if (i < splittedLabel.length - 1 && wordCount < wordsPerLine) {
phrase = phrase + ' '
if (i < splittedLabel.length - 1 && wordCount < wordsPerLine) {
phrase = phrase + ' '
}
if (wordCount >= wordsPerLine) {
phrases.push(phrase)
phrase = ''
wordCount = 0
}
}
if (wordCount >= wordsPerLine) {
if (wordCount > 0) {
phrases.push(phrase)
phrase = ''
wordCount = 0
}
return phrases
} catch (err) {
console.log(err.stack)
}
if (wordCount > 0) {
phrases.push(phrase)
}
return phrases
}
function getTextWidth(text) {