summaryrefslogtreecommitdiff
path: root/app/javascript/controllers/timer_controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/controllers/timer_controller.js')
-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);
}
},
});