Fix TradeRepublic review issues and Brakeman warning

This commit is contained in:
Juan José Mata
2026-04-19 15:18:26 +02:00
parent b32e9dbc45
commit fa3e54ee5e
41 changed files with 3800 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
}
}