mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: ensures relative-ages interval is cleared between tests (#8117)
This commit is contained in:
@@ -3,9 +3,17 @@ import { updateRelativeAge } from "discourse/lib/formatter";
|
|||||||
// Updates the relative ages of dates on the screen.
|
// Updates the relative ages of dates on the screen.
|
||||||
export default {
|
export default {
|
||||||
name: "relative-ages",
|
name: "relative-ages",
|
||||||
initialize: function() {
|
|
||||||
setInterval(function() {
|
initialize() {
|
||||||
|
this._interval = setInterval(function() {
|
||||||
updateRelativeAge($(".relative-date"));
|
updateRelativeAge($(".relative-date"));
|
||||||
}, 60 * 1000);
|
}, 60 * 1000);
|
||||||
|
},
|
||||||
|
|
||||||
|
teardown() {
|
||||||
|
if (this._interval) {
|
||||||
|
clearInterval(this._interval);
|
||||||
|
this._interval = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user