mumuki / mumuki-laboratory

:microscope: Where students practice and receive automated and human feedback
http://mumuki.io
GNU Affero General Public License v3.0
203 stars 26 forks source link

Disable "take care of" button until confirmation toast is shown #1677

Closed felipecalvo closed 3 years ago

felipecalvo commented 3 years ago

:dart: Goal

Prevent multiple clicks on "I'll take care of it" button on discussions when the response is taking longer than usual.

:memo: Details

We've seen cases where moderators would click the button multiple times before waiting for the server to actually mark them as responsible (could be slow internet, an unfortunate lock, too much load on our DB, or else). This would sometimes de-sync the button with the actual state of the discussion and/or with the message shown (i.e.: the button shows you could mark yourself as responsible, but you already are, and therefore clicking will show "you're no longer responsible" instead).

The simplest solution is to disable the button until the action is finished, as is usually done on forms, and as this 'Create pull request' button I'm about to click does. This avoids double-sending.

:camera_flash: Screenshots

About to click / clicked but waiting / response has been sent

image image image