summaryrefslogtreecommitdiff
path: root/app/javascript/controllers
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-06-05 20:46:39 -0400
committerDavid Gay <david@davidgay.org>2021-06-05 20:46:39 -0400
commite5a37756c4dc3b27959bfb1102ac8db9c549409c (patch)
treed94fd9843446bf42db372edd83a758eb3b946cee /app/javascript/controllers
parentb1c8a5b4c3fd7b2f9dbed88c670ee8b4d7f97e16 (diff)
Timer: Switch to 1 minute retries after 5 errors, instead of showing an alert and stopping
Diffstat (limited to 'app/javascript/controllers')
-rw-r--r--app/javascript/controllers/timer_controller.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/javascript/controllers/timer_controller.js b/app/javascript/controllers/timer_controller.js
index 30e64cc..dcf046a 100644
--- a/app/javascript/controllers/timer_controller.js
+++ b/app/javascript/controllers/timer_controller.js
@@ -40,14 +40,15 @@ export default class extends Controller {
Rails.ajax({
type: "POST",
url: controller.postUrlValue,
+ success: () => {
+ this.postFailures = 0;
+ },
error: () => {
this.postFailures++;
if (this.postFailures < 5) {
setTimeout(controller.finishActivity, 1000);
} else {
- alert("There was an error completing your activity. If your internet connection is otherwise working," +
- " please report this issue, mentioning what you were" +
- " doing at the time. Check if refreshing the page resolves this issue, and mention that as well.");
+ setTimeout(controller.finishActivity, 60000);
}
},
});