Skip to content

Commit cba01c8

Browse files
committed
Added prompt to reload when an update is available in the Horizon app
1 parent 5fdad59 commit cba01c8

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

ui/javascript/app/Horizon.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ javaxt.express.app.Horizon = function(parent, config) {
328328
}
329329
},
330330
onTimeout: function(){
331+
connected = false;
331332
if (communicationError) communicationError.hide(true);
332333
if (!timeoutWarning) createTimeoutWarning();
333334
timeoutWarning.show();
@@ -526,12 +527,28 @@ javaxt.express.app.Horizon = function(parent, config) {
526527
if (currUser && currUser.preferences){
527528
var autoReload = currUser.preferences.get("AutoReload");
528529
if (autoReload===true || autoReload==="true"){
529-
console.log("reload!");
530530
location.reload();
531531
}
532532
else{
533-
console.log("prompt to reload!");
534-
location.reload();
533+
confirm({
534+
title: "Update Available",
535+
text: "An update is available for this application. " +
536+
"Would you like to update now?",
537+
leftButton: {
538+
label: "Yes",
539+
value: true
540+
},
541+
rightButton: {
542+
label: "No",
543+
value: false
544+
},
545+
callback: function(answer){
546+
if (answer===true) location.reload();
547+
else{
548+
menuButton.showMessage("Update Available");
549+
}
550+
}
551+
});
535552
}
536553
}
537554
}

0 commit comments

Comments
 (0)