mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-27 23:47:39 +01:00
bug-fix: fix useMainProfile not saved / not set during initialization
SideStore is killed by iOS before CoreData commit changes to db. Detect if the app is installed with useMainProfile by checking if applicationIdentifier matches
This commit is contained in:
@@ -176,6 +176,13 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
|
||||
|
||||
var installing = true
|
||||
if installedApp.storeApp?.bundleIdentifier.range(of: Bundle.Info.appbundleIdentifier) != nil {
|
||||
do {
|
||||
// we need to flush changes to the disk now in case the changes are lost when iOS kills current process
|
||||
try installedApp.managedObjectContext?.save()
|
||||
} catch {
|
||||
print("Failed to flush installedApp to disk: \(error)")
|
||||
}
|
||||
|
||||
// Reinstalling ourself will hang until we leave the app, so we need to exit it without force closing
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
||||
if UIApplication.shared.applicationState != .active {
|
||||
|
||||
Reference in New Issue
Block a user