mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 04:03:26 +01:00
Only updates ALTAppID features when they have changed
This commit is contained in:
@@ -264,6 +264,27 @@ private extension ResignAppOperation
|
|||||||
features[.appGroups] = true
|
features[.appGroups] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var updateFeatures = false
|
||||||
|
|
||||||
|
// Determine whether the required features are already enabled for the AppID.
|
||||||
|
for (feature, value) in features
|
||||||
|
{
|
||||||
|
if let appIDValue = appID.features[feature] as AnyObject?, (value as AnyObject).isEqual(appIDValue)
|
||||||
|
{
|
||||||
|
// AppID already has this feature enabled and the values are the same.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// AppID either doesn't have this feature enabled or the value has changed,
|
||||||
|
// so we need to update it to reflect new values.
|
||||||
|
updateFeatures = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if updateFeatures
|
||||||
|
{
|
||||||
let appID = appID.copy() as! ALTAppID
|
let appID = appID.copy() as! ALTAppID
|
||||||
appID.features = features
|
appID.features = features
|
||||||
|
|
||||||
@@ -271,6 +292,11 @@ private extension ResignAppOperation
|
|||||||
completionHandler(Result(appID, error))
|
completionHandler(Result(appID, error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
completionHandler(.success(appID))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func updateAppGroups(for appID: ALTAppID, app: ALTApplication, team: ALTTeam, session: ALTAppleAPISession, completionHandler: @escaping (Result<ALTAppID, Error>) -> Void)
|
func updateAppGroups(for appID: ALTAppID, app: ALTApplication, team: ALTTeam, session: ALTAppleAPISession, completionHandler: @escaping (Result<ALTAppID, Error>) -> Void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user