Refactor TraderepublicItem sync methods and improve error handling in processor

This commit is contained in:
Juan José Mata
2026-04-18 21:46:59 +02:00
parent 0a96bf199d
commit 727399a2be
40 changed files with 3809 additions and 6 deletions

View File

@@ -0,0 +1,21 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["buttonText", "spinner"]
submit(event) {
// Don't prevent default - let the form submit
// Show spinner and update text
if (this.hasButtonTextTarget) {
this.buttonTextTarget.textContent = "Sending code..."
}
if (this.hasSpinnerTarget) {
this.spinnerTarget.classList.remove("hidden")
}
// Disable the button to prevent double-clicks
event.currentTarget.disabled = true
}
}