diff --git a/counter/static/bundled/counter/counter-click-index.ts b/counter/static/bundled/counter/counter-click-index.ts index 5504cd12..7ec9abc2 100644 --- a/counter/static/bundled/counter/counter-click-index.ts +++ b/counter/static/bundled/counter/counter-click-index.ts @@ -123,14 +123,14 @@ document.addEventListener("alpine:init", () => { onRefillingSuccess(event: CustomEvent) { if ( - event.type !== "htmx:after-swap" || - event.detail.failed || - event.detail.elt.querySelector(".errorlist") + event.type !== "htmx:after:swap" || + event.detail.ctx.response.status !== 200 || + event.detail.ctx.target.querySelector(".errorlist") ) { return; } this.customerBalance += Number.parseFloat( - (event.detail.target.querySelector("#id_amount") as HTMLInputElement).value, + (event.detail.ctx.target.querySelector("#id_amount") as HTMLInputElement).value, ); document.getElementById("selling-accordion")?.setAttribute("open", ""); this.codeField?.widget.focus(); diff --git a/counter/templates/counter/counter_click.jinja b/counter/templates/counter/counter_click.jinja index d18f025e..bccc6f09 100644 --- a/counter/templates/counter/counter_click.jinja +++ b/counter/templates/counter/counter_click.jinja @@ -186,7 +186,7 @@ {% if refilling_fragment %}