FIX: stop stacking, stuff was upgraded dialogs

This commit is contained in:
Sam 2014-07-09 16:43:54 +10:00
parent 0d281d9de6
commit 21bc20169e
1 changed files with 3 additions and 1 deletions

View File

@ -6,12 +6,13 @@ export default {
after: "message-bus",
initialize: function () {
var timeoutIsSet = false;
if (!Discourse.MessageBus) { return; }
Discourse.MessageBus.subscribe("/global/asset-version", function (version) {
Discourse.set("assetVersion", version);
if (Discourse.get("requiresRefresh")) {
if (!timeoutIsSet && Discourse.get("requiresRefresh")) {
// since we can do this transparently for people browsing the forum
// hold back the message a couple of hours
setTimeout(function () {
@ -19,6 +20,7 @@ export default {
if (result) { document.location.reload(); }
});
}, 1000 * 60 * 120);
timeoutIsSet = true;
}
});