Sha256: 938931aa0687b951682801ca1d87641bb9cea6c825c3f3ae1ee10201fb63c03b
Contents?: true
Size: 706 Bytes
Versions: 19
Compression:
Stored size: 706 Bytes
Contents
import dayjs from "dayjs" $(() => { const $impersonationWarning = $(".impersonation-warning"); if ($impersonationWarning.length) { const endsAt = dayjs($impersonationWarning.data("session-ends-at")); const exitInterval = setInterval(() => { const diff = (endsAt - dayjs()) / 60000; const diffInMinutes = Math.round(diff); $impersonationWarning.find(".minutes").html(diffInMinutes); if (diff <= 0) { window.location.reload(); } }, 1000); // Prevent reload when page is already unloading, otherwise it may cause infinite reloads. window.addEventListener("beforeunload", () => { clearInterval(exitInterval); return; }); } });
Version data entries
19 entries across 19 versions & 1 rubygems