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 Jul 25, 2023
1 parent 26f99ee commit a5d57a2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/qml/WebPatchPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ Page {
property bool forceCompatible: PatchManager.sfosVersionCheck !== VersionCheck.Strict
property bool isInstallable: isCompatible || forceCompatible
property bool isReinstallable: isInstalled && isInstallable
//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
}

onClicked: {
if (isReinstallable) {
Expand Down

0 comments on commit a5d57a2

Please sign in to comment.