Skip to content

Commit ed8c468

Browse files
committed
Show Default instead of _ in confirm
1 parent c826cfd commit ed8c468

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/resources/static/js/shiny.instances.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,22 @@ Shiny.instances = {
3939
clearInterval(Shiny.instances._refreshIntervalId);
4040
},
4141
onDeleteInstance: function (instanceName) {
42+
// this function can be called with one of:
43+
// - no argument (i.e. undefined) -> the current instance
44+
// - `_` or `Default` -> both represent the default instance
45+
// - any other name of an instance
46+
4247
if (instanceName === undefined) {
4348
instanceName = Shiny.app.staticState.appInstanceName;
4449
}
45-
if (confirm("Are you sure you want to delete instance \"" + instanceName + "\"?")) {
50+
51+
// show `_` as `Default` in the confirmation message
52+
var displayName = instanceName;
53+
if (displayName === "_") {
54+
displayName = "Default";
55+
}
56+
57+
if (confirm("Are you sure you want to delete instance \"" + displayName + "\"?")) {
4658
Shiny.instances._deleteInstance(instanceName, function () {
4759
if (instanceName === "Default") {
4860
instanceName = "_";

0 commit comments

Comments
 (0)