diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/controllers/timer_controller.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/javascript/controllers/timer_controller.js b/app/javascript/controllers/timer_controller.js index dcf046a..4888f6a 100644 --- a/app/javascript/controllers/timer_controller.js +++ b/app/javascript/controllers/timer_controller.js @@ -43,12 +43,12 @@ export default class extends Controller { success: () => { this.postFailures = 0; }, - error: () => { + error: (e, xhr) => { this.postFailures++; - if (this.postFailures < 5) { - setTimeout(controller.finishActivity, 1000); - } else { - setTimeout(controller.finishActivity, 60000); + if (this.postFailures < 3) { + setTimeout(controller.finishActivity, 1000); // 1 second + } else if (xhr === "") { + setTimeout(controller.finishActivity, 60000); // 1 minute } }, }); |