IdStrategizer removed from workspace

This commit is contained in:
Luis Fernando Molina committed 2019-06-29 11:15:55 +02:00
1 parent 55c7d2c149
commit 06fe11d01f
2 files changed
+5 -8

No files matched your search

+5 -5
View File
@@ -47,12 +47,12 @@ function newStrategizerGateway () {
}
user = JSON.parse(user)
let fbSlug = 'simulator' + '-' + 'bot' + '-' + user.alias.replace('.','')
let fbSlug = 'simulator' + '-' + 'bot' + '-' + user.alias.replace('.', '')
/* See if we need to update or create a new record at the strategizer */
let tradingSystem = canvas.strategySpace.workspace.getProtocolTradingSystem()
let idAtStrategizer = canvas.strategySpace.workspace.idAtStrategizer
let idAtStrategizer = window.localStorage.getItem(MODULE_NAME)
if (idAtStrategizer === undefined) {
let response = await axios({
@@ -85,7 +85,7 @@ function newStrategizerGateway () {
console.log('Error getting events: ' + JSON.stringify(response.data.errors))
throw 'Error getting events: ' + JSON.stringify(response.data.errors)
} else {
canvas.strategySpace.workspace.idAtStrategizer = response.data.data.strategizer_CreateTradingSystem.id
window.localStorage.setItem(MODULE_NAME, response.data.data.strategizer_CreateTradingSystem.id)
}
} else {
const graphQLServer = await axios({
@@ -132,7 +132,7 @@ function newStrategizerGateway () {
}
user = JSON.parse(user)
let fbSlug = 'simulator' + '-' + 'bot' + '-' + user.alias.replace('.','')
let fbSlug = 'simulator' + '-' + 'bot' + '-' + user.alias.replace('.', '')
let response = await axios({
url: window.canvasApp.graphQL.masterAppApiUrl,
@@ -168,7 +168,7 @@ function newStrategizerGateway () {
} else {
window.localStorage.setItem('userStrategies', JSON.stringify(response.data.data.strategizer_TradingSystemByFb.data))
thisObject.strategizerData = JSON.parse(JSON.stringify(response.data.data.strategizer_TradingSystemByFb.data))
canvas.strategySpace.workspace.idAtStrategizer = response.data.data.strategizer_TradingSystemByFb.id
window.localStorage.setItem(MODULE_NAME, response.data.data.strategizer_TradingSystemByFb.id)
return true
}
} catch (err) {
-3
View File
@@ -5,7 +5,6 @@ function newWorkspace () {
let thisObject = {
tradingSystem: undefined,
container: undefined,
idAtStrategizer: undefined,
onMenuItemClick: onMenuItemClick,
getProtocolTradingSystem: getProtocolTradingSystem,
physics: physics,
@@ -64,7 +63,6 @@ function newWorkspace () {
} else {
workspace = JSON.parse(savedWorkspace)
rootNodes = workspace.rootNodes
thisObject.idAtStrategizer = workspace.idAtStrategizer
for (let i = 0; i < rootNodes.length; i++) {
let rootNode = rootNodes[i]
@@ -120,7 +118,6 @@ function newWorkspace () {
stringifyReadyNodes.push(workspaceNode)
}
let workspace = {
idAtStrategizer: thisObject.idAtStrategizer,
rootNodes: stringifyReadyNodes
}
let textToSave = JSON.stringify(workspace)