openfoodfacts / hunger-games

One click Mini-Games for Open Food Facts
https://hunger.openfoodfacts.org
22 stars 38 forks source link

Validate answers in the buffer when quitting the page #194

Open alexfauquette opened 2 years ago

alexfauquette commented 2 years ago

For now, there is 5seconds between the moment you press "YES" and the moment the annotation is sent to robotoff.

It allows to revert the last answers you clicked because you went too fast. But the draw back is when you quite the page (close the page or simply move to another game) the annotations will never been sent to robotoff

image

I discovered this issue when doing nutriscroes. I finished the nutriscore A, and went back to the home page to do another one, and I always had 3 answered questions. That was because I moved to the home page right after answering, so 3 last annotations were never sent to the server 😅

VaiTon commented 2 years ago

Or maybe we could do like some mail webclient do, which is showing a dialog with "Are you sure you want to exit? Changes will be lost!"