Skip to content

Commit

Permalink
Plotly: tweak message loading. loadedMessages was not being resposive…
Browse files Browse the repository at this point in the history
… to changes in state
  • Loading branch information
Williangalvani committed Jun 17, 2023
1 parent f4ffcac commit 9100a29
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/Plotly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default {
return new Promise((resolve, reject) => {
interval = setInterval(function () {
for (const message of messages) {
if (!_this.loadedMessages.includes(message.split('[')[0])) {
if (!_this.loadedMessages().includes(message.split('[')[0])) {
counter += 1
if (counter > 30) { // 30 * 300ms = 9 s timeout
console.log('not resolving')
Expand Down Expand Up @@ -736,6 +736,10 @@ export default {
},
plot () {
console.log('plot()')
if (this.state.expressions.length === 0) {
console.log('no expressions to plot')
return
}
plotOptions.title = this.state.file
const _this = this
const datasets = []
Expand Down Expand Up @@ -1058,6 +1062,11 @@ export default {
...annotationsParams
]
]
},
loadedMessages () {
return Object.keys(this.state.messages).map(key => {
return key.split('[')[0]
})
}
},
computed: {
Expand All @@ -1079,11 +1088,6 @@ export default {
expressions () {
return this.state.expressions
},
loadedMessages () {
return Object.keys(this.state.messages).map(key => {
return key.split('[')[0]
})
},
messagesInLog () {
return Object.keys(this.state.messageTypes).map(key => {
return key.split('[')[0]
Expand Down

0 comments on commit 9100a29

Please sign in to comment.