Disable relationship action buttons while waiting for a response
This commit is contained in:
parent
460017d4d4
commit
59c0dce9b4
|
@ -7,6 +7,7 @@ export function userActionHandler(event: Event): void {
|
||||||
const button: HTMLButtonElement = event.target as HTMLButtonElement;
|
const button: HTMLButtonElement = event.target as HTMLButtonElement;
|
||||||
const target = button.dataset.target;
|
const target = button.dataset.target;
|
||||||
const action = button.dataset.action;
|
const action = button.dataset.action;
|
||||||
|
button.disabled = true;
|
||||||
|
|
||||||
let targetURL, relationshipType;
|
let targetURL, relationshipType;
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ export function userActionHandler(event: Event): void {
|
||||||
showErrorNotification(I18n.translate('frontend.error.message'));
|
showErrorNotification(I18n.translate('frontend.error.message'));
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
button.disabled = false;
|
||||||
if (!success) return;
|
if (!success) return;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
|
Loading…
Reference in New Issue