1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-21 06:09:38 +02:00

Fix event handler removal on disconnect (#540)

* Fix event handler removal on disconnect

* Fix tab controller
This commit is contained in:
Jakub Kottnauer 2024-03-11 22:42:18 +01:00 committed by GitHub
parent c60ddaec1d
commit 2c3752668a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 25 deletions

View file

@ -7,14 +7,14 @@ export default class extends Controller {
connect() {
this.renderChart(this.seriesValue);
document.addEventListener("turbo:load", this.renderChart.bind(this));
document.addEventListener("turbo:load", this.renderChart);
}
disconnect() {
document.removeEventListener("turbo:load", this.renderChart.bind(this));
document.removeEventListener("turbo:load", this.renderChart);
}
renderChart() {
renderChart = () => {
this.drawChart(this.seriesValue);
}