Skip to content

Commit

Permalink
Global JS Var Fixes (#25)
Browse files Browse the repository at this point in the history
fixed issue where install never completed because installData global var was being emptied in the wrong place
cleaned up update modal so it get cleaned and data is emptied when clicking on a new update app
  • Loading branch information
ckrew authored Feb 28, 2024
1 parent dab5e78 commit 25ea754
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 8 additions & 1 deletion tethysapp/app_store/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,12 @@ const startInstall = (appName, channel_app, label_app, current_version) => {
$(`#${appName}_installer`).prop("disabled", true)
$(`#${appName}_installer`).css('opacity', '.5');
installRunning = true
installData["version"] = current_version
installData = {
name: appName,
channel: channel_app,
label: label_app,
version: current_version
}

notification_ws.send(
JSON.stringify({
Expand Down Expand Up @@ -394,6 +399,8 @@ function dismissAddRelatedObjectPopup(win, newId, newRepr) {
)
}



const uninstall = () => {
// Hide Elements
$("#uninstallingAppNotice").hide()
Expand Down
8 changes: 3 additions & 5 deletions tethysapp/app_store/public/js/mainTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ window.operateEvents = {
let n_div = $("#notification")
let n_content = $("#notification .lead")
let isUsingIncompatible = $(e.target).attr("class").includes("incompatible-app")
let appList = isUsingIncompatible ? incompatibleApps : availableApps
n_content.empty();
n_div.modal({ backdrop: "static", keyboard: false })
n_div.modal('show')
Expand All @@ -451,7 +450,6 @@ window.operateEvents = {
// Setup Versions
let appName = row['name'];
$("#installingAppName").text(appName)
installData["name"] = appName
let channel_and_label = get_channel_label_from_id(e);
let selectedVersion = e.target.innerText;
let app_type = row['app_type'];
Expand Down Expand Up @@ -495,9 +493,9 @@ window.operateEvents = {
},

"click .update": function(e, value, row, index) {
let n_content = $("#update-notices .lead")
// Find The installed App's version
let installedApp = row["name"]
$("#update-app-notice").empty()
$("#update_failMessage").hide()
updateData = {}
for(channel in row['installedVersion']){
for(label in row['installedVersion'][channel]){
let htmlCurrentVersion = '';
Expand Down
2 changes: 1 addition & 1 deletion tethysapp/app_store/public/js/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ const sendNotification = (message, n_content) => {
type: `restart_server`
})
)
resetInstallStatus()
} else if (message == "Uninstall completed. Restarting server...") {
inRestart = true
notification_ws.send(
Expand Down Expand Up @@ -127,6 +126,7 @@ function startWS(websocketServerLocation, n_content) {
$("#doneInstallButton").show()
// Hide Cancel Button
$("#mainCancel").hide()
resetInstallStatus()
}
}
// Check if we have any updateData
Expand Down

0 comments on commit 25ea754

Please sign in to comment.