Skip to content

Commit eb83596

Browse files
committed
minor
1 parent 2fcb97c commit eb83596

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

services/static-webserver/client/source/class/osparc/NewUITracker.js

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,27 @@ qx.Class.define("osparc.NewUITracker", {
2626
members: {
2727
__checkInterval: null,
2828

29-
checkNewUI: function() {
30-
osparc.NewRelease.isMyFrontendOld()
31-
.then(newReleaseAvailable => {
32-
if (newReleaseAvailable) {
33-
let msg = "";
34-
msg += qx.locale.Manager.tr("A new version of the application is now available.");
35-
msg += "<br>";
36-
msg += qx.locale.Manager.tr("Reload the page to get the latest features.");
37-
// permanent message
38-
osparc.FlashMessenger.logAs(msg, "INFO", 0).set({
39-
maxWidth: 500
40-
});
41-
// stop tracker in case it was running
42-
this.stopTracker();
43-
}
44-
})
45-
.catch(() => setTimeout(() => checkNewUI(), 5*1000));
46-
},
47-
4829
startTracker: function() {
49-
this.checkNewUI();
50-
this.__checkInterval = setInterval(() =>{
51-
this.checkNewUI();
52-
}, this.self().CHECK_INTERVAL);
30+
const checkNewUI = () => {
31+
osparc.NewRelease.isMyFrontendOld()
32+
.then(newReleaseAvailable => {
33+
if (newReleaseAvailable) {
34+
let msg = "";
35+
msg += qx.locale.Manager.tr("A new version of the application is now available.");
36+
msg += "<br>";
37+
msg += qx.locale.Manager.tr("Reload the page to get the latest features.");
38+
// permanent message
39+
osparc.FlashMessenger.logAs(msg, "INFO", 0).set({
40+
maxWidth: 500
41+
});
42+
// stop tracker in case it was running
43+
this.stopTracker();
44+
}
45+
})
46+
.catch(() => setTimeout(() => checkNewUI(), 5*1000));
47+
};
48+
49+
this.__checkInterval = setInterval(() => checkNewUI(), this.self().CHECK_INTERVAL);
5350
},
5451

5552
stopTracker: function() {

0 commit comments

Comments
 (0)