Skip to content

Commit

Permalink
avoid spamming email inboxes. hotfix, deployed to production 😳
Browse files Browse the repository at this point in the history
  • Loading branch information
adRn-s committed Sep 24, 2024
1 parent ec514ed commit 10e0242
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
========

- TODO: `<URL>/export_request/` and `<URL>/import_request/` both have a simple UI
- E-mail communications: grayed-out "send" button after 1 click, to avoid spamming inboxes.
- Fixtures: save_initial_data management cmd will use built-in json formatter instead of `jq`.
- ...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Ext.define("MainHub.view.requests.EmailWindowController", {
return;
}

btn.setDisabled(true);
btn.setText("Sending...");

form.submit({
url: Ext.String.format(
"api/requests/{0}/send_email/",
Expand All @@ -47,6 +50,8 @@ Ext.define("MainHub.view.requests.EmailWindowController", {
: action.response.statusText;
new Noty({ text: error, type: "error" }).show();
console.error(action);
btn.setDisabled(false);
btn.setText("Send");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Ext.define("MainHub.view.requests.TokenWindowController", {
return;
}

btn.setDisabled(true);
btn.setText("Sending...");

form.submit({
url: Ext.String.format(
"api/requests/{0}/solicit_approval/",
Expand All @@ -47,6 +50,8 @@ Ext.define("MainHub.view.requests.TokenWindowController", {
: action.response.statusText;
new Noty({ text: error, type: "error" }).show();
console.error(action);
btn.setDisabled(false);
btn.setText("Send");
}
});
}
Expand Down

0 comments on commit 10e0242

Please sign in to comment.