mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Prevent the user from launching multiple jobs by rapidly clicking on buttons
This commit is contained in:
parent
3eaea396be
commit
480aaeace5
@ -47,6 +47,9 @@ function LaunchButton({ resource, children }) {
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const handleLaunch = async () => {
|
||||
if (isLaunching) {
|
||||
return;
|
||||
}
|
||||
setIsLaunching(true);
|
||||
const readLaunch =
|
||||
resource.type === 'workflow_job_template'
|
||||
@ -104,6 +107,10 @@ function LaunchButton({ resource, children }) {
|
||||
};
|
||||
|
||||
const launchWithParams = async (params) => {
|
||||
if (isLaunching) {
|
||||
return;
|
||||
}
|
||||
setIsLaunching(true);
|
||||
try {
|
||||
let jobPromise;
|
||||
|
||||
@ -141,6 +148,9 @@ function LaunchButton({ resource, children }) {
|
||||
let readRelaunch;
|
||||
let relaunch;
|
||||
|
||||
if (isLaunching) {
|
||||
return;
|
||||
}
|
||||
setIsLaunching(true);
|
||||
if (resource.type === 'inventory_update') {
|
||||
// We'll need to handle the scenario where the src no longer exists
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user