mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:39:53 +01:00
Merge pull request #1060 from Retrospring/fix/disable-relationship-buttons-on-submit
Disable relationship action buttons while waiting for a response
This commit is contained in:
commit
46bf8ec841
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ export function userActionHandler(event: Event): void {
|
|||
const button: HTMLButtonElement = event.target as HTMLButtonElement;
|
||||
const target = button.dataset.target;
|
||||
const action = button.dataset.action;
|
||||
button.disabled = true;
|
||||
|
||||
let targetURL, relationshipType;
|
||||
|
||||
|
@ -56,6 +57,7 @@ export function userActionHandler(event: Event): void {
|
|||
showErrorNotification(I18n.translate('frontend.error.message'));
|
||||
})
|
||||
.finally(() => {
|
||||
button.disabled = false;
|
||||
if (!success) return;
|
||||
|
||||
switch (action) {
|
||||
|
|
Loading…
Reference in a new issue