DEV: ensures relative-ages interval is cleared between tests (#8117)
This commit is contained in:
parent
b4d42d1151
commit
bbc250cc35
|
@ -3,9 +3,17 @@ import { updateRelativeAge } from "discourse/lib/formatter";
|
|||
// Updates the relative ages of dates on the screen.
|
||||
export default {
|
||||
name: "relative-ages",
|
||||
initialize: function() {
|
||||
setInterval(function() {
|
||||
|
||||
initialize() {
|
||||
this._interval = setInterval(function() {
|
||||
updateRelativeAge($(".relative-date"));
|
||||
}, 60 * 1000);
|
||||
},
|
||||
|
||||
teardown() {
|
||||
if (this._interval) {
|
||||
clearInterval(this._interval);
|
||||
this._interval = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue