Skip to content

Commit 636f176

Browse files
authored
Fixes accumulation of event listeners (#269)
1 parent 4d8006c commit 636f176

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/filters/filters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ const filters = {
154154
) => {
155155
const param =
156156
typeof unitOrObject == "string" ? { unit: unitOrObject } : unitOrObject;
157-
console.log(`param`, param);
158157
const unit = param.unit ?? "h";
159158
const reset_every = parseTimeDuration(param.reset_every ?? "0s");
160159
const offset = parseTimeDuration(param.offset ?? "0s");

src/plotly-graph-card.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ export class PlotlyGraph extends HTMLElement {
356356
this.fetchScheduled = false;
357357
let i = 0;
358358
while (!(this.config && this.hass && this.isConnected)) {
359-
if (i++ > 10) throw new Error("Card didn't load");
359+
if (i++ > 50) throw new Error("Card didn't load");
360360
console.log("waiting for loading");
361361
await sleep(100);
362362
}
@@ -418,7 +418,7 @@ export class PlotlyGraph extends HTMLElement {
418418
}
419419
this.contentEl.style.visibility = "";
420420
});
421-
// this.handles.dataClick?.off("plotly_click", this.onDataClick)!;
421+
this.handles.dataClick?.off("plotly_click", this.onDataClick)!;
422422
this.handles.dataClick = this.contentEl.on(
423423
"plotly_click",
424424
this.onDataClick

0 commit comments

Comments
 (0)