Skip to content

Commit

Permalink
relax version checking in WebPatchPage
Browse files Browse the repository at this point in the history
Contributes-To: sailfishos-patches#322
  • Loading branch information
nephros committed Jan 7, 2023
1 parent ebec2bf commit 3e6fa6a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/qml/WebPatchPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,13 @@ Page {
width: parent.width
contentHeight: filesContent.height
property bool isInstalled: !!container.versions && container.versions[modelData.project] == modelData.version
property bool isCompatible: modelData.compatible.indexOf(PatchManager.osVersion) >= 0
//property bool isCompatible: modelData.compatible.indexOf(PatchManager.osVersion) >= 0
property bool isCompatible: {
const osv = PatchManager.osVersion;
const checkVersion = osv.substr(osv.length - 3, osv.length ) // allow any patch compatible with minor-minor, assumes X.Y.Z.mm
const compatVersions = modelData.compatible.map(function(v) { return v.substr(v.length -3, v.length) }) // reduce list of versions to X.Y.Z "compatible"
return compatVersions.indexOf(checkVersion) >= 0
}
property bool isReinstallable: isInstalled && isCompatible

onClicked: {
Expand Down

0 comments on commit 3e6fa6a

Please sign in to comment.