ACE-IoT-Solutions / ace-svg-react

Grafana SVG Rendering Panel using the 7+ Plugin Framework
https://grafana.com/grafana/plugins/aceiot-svg-panel/
MIT License
40 stars 14 forks source link

Defocusing init code after editing re-runs previous version of init, not the most recent edits #18

Closed acedrew closed 2 years ago

acedrew commented 3 years ago

When leaving the init code edit window, the code that was present the last time the editor was defocused is ran, not the most recent.

acedrew commented 2 years ago

@evannorton if there isn't an obvious solution for this, a button that triggers a complete re-init is a requested feature that would be a better workaround than what we have.

evannorton commented 2 years ago

image The problem was that on line 212 you set this.state.initFunction to the new value, but on 223 you reference the old state instead of this new value. About to put in a simple PR to fix this.