@@ -35,7 +35,7 @@ import TextFormat
3535import ReactionSelectionNode
3636import EntityKeyboard
3737import GlassBackgroundComponent
38- import EdgeEffect
38+ import PremiumUI
3939
4040extension VideoChatCall {
4141 var myAudioLevelAndSpeaking : Signal < ( Float , Bool ) , NoError > {
@@ -3815,50 +3815,40 @@ final class VideoChatScreenComponent: Component {
38153815 }
38163816
38173817 reactionContextNode. premiumReactionsSelected = { [ weak self] file in
3818- guard let self, let component = self . component else {
3818+ guard let self, let component = self . component, let environment = self . environment , let controller = environment . controller ( ) else {
38193819 return
38203820 }
3821+ let context = component. initialCall. accountContext
38213822
3822- let _ = component
3823+ guard let file else {
3824+ var replaceImpl : ( ( ViewController ) -> Void ) ?
3825+ let demoController = PremiumDemoScreen ( context: context, subject: . uniqueReactions, forceDark: true , action: {
3826+ let introController = PremiumIntroScreen ( context: context, source: . reactions)
3827+ replaceImpl ? ( introController)
3828+ } )
3829+ replaceImpl = { [ weak demoController] c in
3830+ demoController? . replace ( with: c)
3831+ }
3832+ controller. push ( demoController)
3833+ return
3834+ }
38233835
3824- // guard let file else {
3825- // let context = component.context
3826- // var replaceImpl: ((ViewController) -> Void)?
3827- // let controller = PremiumDemoScreen(context: context, subject: .uniqueReactions, forceDark: true, action: {
3828- // let controller = PremiumIntroScreen(context: context, source: .reactions)
3829- // replaceImpl?(controller)
3830- // })
3831- // controller.disposed = { [weak self] in
3832- // self?.updateIsProgressPaused()
3833- // }
3834- // replaceImpl = { [weak controller] c in
3835- // controller?.replace(with: c)
3836- // }
3837- // component.controller()?.push(controller)
3838- // return
3839- // }
3840- //
3841- // let presentationData = component.context.sharedContext.currentPresentationData.with { $0 }
3842- // let undoController = UndoOverlayController(presentationData: presentationData, content: .sticker(context: component.context, file: file, loop: true, title: nil, text: presentationData.strings.Chat_PremiumReactionToastTitle, undoText: presentationData.strings.Chat_PremiumReactionToastAction, customAction: { [weak self] in
3843- // guard let self, let component = self.component else {
3844- // return
3845- // }
3846- //
3847- // let context = component.context
3848- // var replaceImpl: ((ViewController) -> Void)?
3849- // let controller = PremiumDemoScreen(context: context, subject: .uniqueReactions, forceDark: true, action: {
3850- // let controller = PremiumIntroScreen(context: context, source: .reactions)
3851- // replaceImpl?(controller)
3852- // })
3853- // controller.disposed = { [weak self] in
3854- // self?.updateIsProgressPaused()
3855- // }
3856- // replaceImpl = { [weak controller] c in
3857- // controller?.replace(with: c)
3858- // }
3859- // component.controller()?.push(controller)
3860- // }), elevatedLayout: false, animateInAsReplacement: false, appearance: UndoOverlayController.Appearance(isBlurred: true), action: { _ in true })
3861- // component.controller()?.present(undoController, in: .current)
3836+ let presentationData = context. sharedContext. currentPresentationData. with { $0 }
3837+ let undoController = UndoOverlayController ( presentationData: presentationData, content: . sticker( context: context, file: file, loop: true , title: nil , text: presentationData. strings. Chat_PremiumReactionToastTitle, undoText: presentationData. strings. Chat_PremiumReactionToastAction, customAction: { [ weak controller] in
3838+ guard let controller else {
3839+ return
3840+ }
3841+ var replaceImpl : ( ( ViewController ) -> Void ) ?
3842+ let demoController = PremiumDemoScreen ( context: context, subject: . uniqueReactions, forceDark: true , action: {
3843+ let introController = PremiumIntroScreen ( context: context, source: . reactions)
3844+ replaceImpl ? ( introController)
3845+ } )
3846+ replaceImpl = { [ weak demoController] c in
3847+ demoController? . replace ( with: c)
3848+ }
3849+ controller. push ( demoController)
3850+ } ) , elevatedLayout: false , animateInAsReplacement: false , appearance: UndoOverlayController . Appearance ( isBlurred: true ) , action: { _ in true } )
3851+ controller. present ( undoController, in: . current)
38623852 }
38633853 }
38643854
0 commit comments