Skip to content

Commit

Permalink
Fix some bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Incognito committed Feb 5, 2022
1 parent 45e4d3b commit 91378d6
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions src/ui/about.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,6 @@ ColumnLayout {
}
}

Button {
id: buttonAppUpgrade
text: qsTr("Upgrade")
visible: false
property var value

contentItem: Text {
text: parent.text
color: parent.enabled ? "#3498db" : "#ccc"
font.pointSize: 10.5
}
background: Rectangle {
color: "#2e3e4e"
radius: 4
}
onClicked: function() {
Qt.openUrlExternally(
"https://github.com/Dr-Incognito/V2Ray-Desktop/releases/tag/" +
buttonAppUpgrade.value.substr(1))
}
}

Label {
text: qsTr("Clash Version")
color: "white"
Expand Down Expand Up @@ -155,15 +133,13 @@ ColumnLayout {
}

function onLatestReleaseReady(name, latestVersion) {
var buttonCheckUpdates, buttonUpgrade, labelVersion
var buttonCheckUpdates, labelVersion

if (name === "v2ray-core") {
buttonCheckUpdates = buttonV2RayCheckUpdates
buttonUpgrade = buttonV2RayUpgrade
labelVersion = labelV2rayVersion
} else if (name === "v2ray-desktop") {
buttonCheckUpdates = buttonAppCheckUpdates
buttonUpgrade = buttonAppUpgrade
labelVersion = labelAppVersion
}
if (latestVersion.length === 0) {
Expand All @@ -172,16 +148,13 @@ ColumnLayout {
} else {
labelVersion.text = labelVersion.value + " (" +
qsTr("Newer verion available: ") + latestVersion + ")"
buttonCheckUpdates.visible = false
buttonUpgrade.visible = true
buttonUpgrade.value = latestVersion
}
buttonCheckUpdates.text = qsTr("Check for updates")
buttonCheckUpdates.enabled = true
}

function onLatestReleaseError(name, errorMsg) {
var buttonCheckUpdates, buttonUpgrade, labelVersion
var buttonCheckUpdates, labelVersion

if (name === "v2ray-core") {
buttonCheckUpdates = buttonV2RayCheckUpdates
Expand Down

0 comments on commit 91378d6

Please sign in to comment.