Add time limit for inactive sessions

closes #8
This commit is contained in:
Râu Cao committed 2023-03-19 16:16:36 +07:00
1 parent 90680368fb
commit e2618de7c6
3 files changed
+7 -2

No files matched your search

@@ -4,6 +4,10 @@ export default class extends Controller {
static targets = ["buttons", "countdown"]
connect() {
// Devise timeoutable ends up adding a second flash message without content
// TODO investigate bug
if (this.element.textContent.trim() == "true") return;
const timeoutSeconds = parseInt(this.data.get("timeout"));
setTimeout(() => {