Fix avatar setup crash

This commit is contained in:
Ilya Laktyushin
2023-01-14 13:54:15 +04:00
parent 5ce25538d6
commit ce08d17d29
4 changed files with 5 additions and 7 deletions

View File

@@ -6152,12 +6152,10 @@ public final class VoiceChatControllerImpl: ViewController, VoiceChatController
if !peer.profileImageRepresentations.isEmpty {
hasPhotos = true
}
let paintStickersContext = LegacyPaintStickersContext(context: strongSelf.context)
let mixin = TGMediaAvatarMenuMixin(context: legacyController.context, parentController: emptyController, hasSearchButton: true, hasDeleteButton: hasPhotos && !fromGallery, hasViewButton: false, personalPhoto: peerId.namespace == Namespaces.Peer.CloudUser, isVideo: false, saveEditedPhotos: false, saveCapturedMedia: false, signup: false, forum: false, title: nil, isSuggesting: false)!
mixin.forceDark = true
mixin.stickersContext = paintStickersContext
mixin.stickersContext = LegacyPaintStickersContext(context: strongSelf.context)
let _ = strongSelf.currentAvatarMixin.swap(mixin)
mixin.requestSearchController = { [weak self] assetsController in
guard let strongSelf = self else {