Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 52ecc26

Browse files
committed
webui: Ensure success message isn't skipped when deleting saved SQL
1 parent 8dea3e5 commit 52ecc26

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

webui/templates/execute.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ <h4 style="color: {{ statusMessageColour }};" data-cy="statusmsg">&nbsp;{{ statu
198198
if (arrIdx > -1) {
199199
$http.get("/x/execdel/[[ .DB.Info.Owner ]]/[[ .DB.Info.Database ]]?sqlname="+name).then(
200200
function success(response) {
201-
$scope.statusMessageColour = "green";
202-
$scope.statusMessage = nowString() + "SQL statement '" + name + "' deleted";
203-
204201
// Remove the SQL statement from the drop-down list
205202
$scope.execNames.splice(arrIdx, 1);
206203

@@ -211,8 +208,17 @@ <h4 style="color: {{ statusMessageColour }};" data-cy="statusmsg">&nbsp;{{ statu
211208
$scope.selectedName = newSelected;
212209
document.getElementById("savename").value = newSelected;
213210
$scope.changeExec(newSelected);
211+
212+
// We need to set the status message here too, otherwise the ~async changeExec() above
213+
// can overwrite it
214+
$scope.statusMessageColour = "green";
215+
$scope.statusMessage = nowString() + "SQL statement '" + name + "' deleted";
214216
}
215217
}
218+
219+
// Display a success message
220+
$scope.statusMessageColour = "green";
221+
$scope.statusMessage = nowString() + "SQL statement '" + name + "' deleted";
216222
}, function failure(response) {
217223
// The deletion failed, so display the returned error message
218224
$scope.statusMessageColour = "red";

0 commit comments

Comments
 (0)