Fix set default icon

This commit is contained in:
Isaac 2025-09-27 00:09:05 +08:00
parent c49713e4d1
commit 75722ecbde
2 changed files with 7 additions and 11 deletions

View file

@ -575,7 +575,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
pushControllerImpl?(controller)
} else {
currentAppIconName.set(icon.name)
context.sharedContext.applicationBindings.requestSetAlternateIconName(icon.name, { _ in
context.sharedContext.applicationBindings.requestSetAlternateIconName(icon.isDefault ? nil : icon.name, { _ in
})
}
})

View file

@ -888,16 +888,12 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
return nil
}
}, requestSetAlternateIconName: { name, completion in
if #available(iOS 10.3, *) {
application.setAlternateIconName(name, completionHandler: { error in
if let error = error {
Logger.shared.log("App \(self.episodeId)", "failed to set alternate icon with error \(error.localizedDescription)")
}
completion(error == nil)
})
} else {
completion(false)
}
application.setAlternateIconName(name, completionHandler: { error in
if let error = error {
Logger.shared.log("App \(self.episodeId)", "failed to set alternate icon with error \(error.localizedDescription)")
}
completion(error == nil)
})
}, forceOrientation: { orientation in
let value = orientation.rawValue
if #available(iOSApplicationExtension 16.0, iOS 16.0, *) {