Merge branch 'develop' of https://github.com/Superalgos/Superalgos into develop

This commit is contained in:
Julian Molina committed 2021-08-21 15:25:44 +02:00
commit a5380e59da
2 files changed
+18 -9

No files matched your search

@@ -420,6 +420,7 @@ function newWorkspace() {
thisObject.isInitialized = true
UI.projects.governance.spaces.reportsSpace.reset()
UI.projects.governance.spaces.userProfileSpace.reset()
await UI.projects.education.spaces.docsSpace.reset()
await UI.projects.education.spaces.tutorialSpace.reset()
@@ -9,21 +9,14 @@ function newGovernanceUserProfileSpace() {
physics: physics,
draw: draw,
getContainer: getContainer,
reset: reset,
finalize: finalize,
initialize: initialize
}
thisObject.container = newContainer()
thisObject.container.initialize(MODULE_NAME)
thisObject.container.isDraggeable = false
let waitingForResponses = 0
let timer = 0
thisObject.githubStars = new Map()
thisObject.githubWatchers = new Map()
thisObject.githubForks = new Map()
let reputationByAddress = new Map()
return thisObject
@@ -34,7 +27,13 @@ function newGovernanceUserProfileSpace() {
Superalgos Repository. This will later be used to know which user profiles are participating
at the Github Program.
*/
thisObject.githubStars = new Map()
thisObject.githubWatchers = new Map()
thisObject.githubForks = new Map()
thisObject.container = newContainer()
thisObject.container.initialize(MODULE_NAME)
thisObject.container.isDraggeable = false
/*
If the workspace is not related to governance, then we exit the Intialize Function
*/
@@ -95,6 +94,8 @@ function newGovernanceUserProfileSpace() {
}
if (tokenTransfers.length > 9000) {
console.log('[WARN] The total amount of BSC SA Token transfers is above 9000. After 10k this method will need pagination or otherwise users will not get their reputation calculated correctly.')
} else {
console.log('[INFO] ' + tokenTransfers.length + ' reputation trasactions found at the blockchain. ')
}
waitingForResponses--
}).catch(function (err) {
@@ -244,11 +245,18 @@ function newGovernanceUserProfileSpace() {
function finalize() {
thisObject.githubStars = undefined
thisObject.githubWatchers = undefined
thisObject.githubForks = undefined
thisObject.container.finalize()
thisObject.container = undefined
}
function reset() {
finalize()
initialize()
}
function getContainer(point) {
return undefined // since this space does not draw anything we return here
@@ -341,7 +349,7 @@ function newGovernanceUserProfileSpace() {
console.log(data)
userProfile.payload.uiObject.setInfoMessage(data)
userProfile.payload.blockchainTokens = Number(data.result) / 1000000000000000000
userProfile.payload.reputation = Math.min(reputationByAddress.get(blockchainAccount.toLowerCase()) | 0, userProfile.payload.blockchainTokens)
userProfile.payload.reputation = Math.min(reputationByAddress.get(blockchainAccount.toLowerCase()) | 0, userProfile.payload.blockchainTokens)
waitingForResponses--
}).catch(function (err) {
const message = err.message + ' - ' + 'Can not access BSC SCAN servers.'