mirror of
https://github.com/we-promise/sure.git
synced 2026-04-23 05:54:08 +00:00
Refactor TraderepublicItem sync methods and improve error handling in processor
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user