-
-
Notifications
You must be signed in to change notification settings - Fork 698
Prevent multiple initialization #251
Copy link
Copy link
Open
Description
Apparently, it's easy to get things wrong and call timeago() multiple times on the same element. It would be great if the init function would in this case not set a new interval without clearing the old one, e.g. if you'd replace
if ($s.refreshMillis > 0) {
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
}
with
if ($s.refreshMillis > 0 && this._timeagoInterval == null) {
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels