Various fixes

This commit is contained in:
Ilya Laktyushin 2023-12-18 02:31:48 +04:00
parent 1b66f573c7
commit 42e2576dce
5 changed files with 23 additions and 8 deletions

View File

@ -1074,7 +1074,7 @@ final class ShareControllerNode: ViewControllerTracingNode, UIScrollViewDelegate
self?.switchToAnotherAccount?()
}, debugAction: { [weak self] in
self?.debugAction?()
}, extendedInitialReveal: self.presetText != nil, segmentedValues: self.segmentedValues)
}, extendedInitialReveal: self.presetText != nil, segmentedValues: self.segmentedValues, fromPublicChannel: self.fromPublicChannel)
self.peersContentNode = peersContentNode
peersContentNode.openSearch = { [weak self] in
let _ = (_internal_recentlySearchedPeers(postbox: context.stateManager.postbox)

View File

@ -145,7 +145,7 @@ final class SharePeersContainerNode: ASDisplayNode, ShareContentContainerNode {
}
private let tick = ValuePromise<Int>(0)
init(environment: ShareControllerEnvironment, context: ShareControllerAccountContext, switchableAccounts: [ShareControllerSwitchableAccount], theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, peers: [(EngineRenderedPeer, EnginePeer.Presence?)], accountPeer: EnginePeer, controllerInteraction: ShareControllerInteraction, externalShare: Bool, switchToAnotherAccount: @escaping () -> Void, debugAction: @escaping () -> Void, extendedInitialReveal: Bool, segmentedValues: [ShareControllerSegmentedValue]?) {
init(environment: ShareControllerEnvironment, context: ShareControllerAccountContext, switchableAccounts: [ShareControllerSwitchableAccount], theme: PresentationTheme, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, peers: [(EngineRenderedPeer, EnginePeer.Presence?)], accountPeer: EnginePeer, controllerInteraction: ShareControllerInteraction, externalShare: Bool, switchToAnotherAccount: @escaping () -> Void, debugAction: @escaping () -> Void, extendedInitialReveal: Bool, segmentedValues: [ShareControllerSegmentedValue]?, fromPublicChannel: Bool) {
self.environment = environment
self.context = context
self.theme = theme
@ -170,7 +170,7 @@ final class SharePeersContainerNode: ASDisplayNode, ShareContentContainerNode {
var index: Int32 = 0
if canShareStory {
entries.append(SharePeerEntry(index: index, item: .story(isMessage: false), theme: theme, strings: strings))
entries.append(SharePeerEntry(index: index, item: .story(isMessage: fromPublicChannel), theme: theme, strings: strings))
index += 1
}

View File

@ -51,7 +51,7 @@ public struct UserLimitsConfiguration: Equatable {
maxStoriesSuggestedReactions: 1,
maxGiveawayChannelsCount: 10,
maxGiveawayCountriesCount: 10,
maxGiveawayPeriodSeconds: 86400 * 7,
maxGiveawayPeriodSeconds: 86400 * 31,
maxChannelRecommendationsCount: 10
)
}

View File

@ -2087,6 +2087,8 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
private var presentationData: PresentationData
private var validLayout: ContainerViewLayout?
private let readyValue = Promise<Bool>()
init(controller: MediaEditorScreen) {
self.controller = controller
self.context = controller.context
@ -2360,6 +2362,11 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
}
}
if case .message = subject {
} else {
self.readyValue.set(.single(true))
}
if case let .image(_, _, additionalImage, position) = subject, let additionalImage {
let image = generateImage(CGSize(width: additionalImage.size.width, height: additionalImage.size.width), contextGenerator: { size, context in
let bounds = CGRect(origin: .zero, size: size)
@ -2422,9 +2429,10 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
messageEntity.scale = 3.3 * fraction
self.entitiesView.add(messageEntity, announce: false)
self.readyValue.set(.single(true))
})
})
}
self.gradientColorsDisposable = mediaEditor.gradientColors.start(next: { [weak self] colors in
@ -4088,7 +4096,14 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
controller.presentationContext.containerLayoutUpdated(layout, transition: transition.containedViewLayoutTransition)
if isFirstTime {
self.animateIn()
self.isHidden = true
let _ = (self.readyValue.get()
|> take(1)).start(next: { [weak self] _ in
if let self {
self.isHidden = false
self.animateIn()
}
})
}
}
}
@ -4221,7 +4236,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
private var audioSessionDisposable: Disposable?
private let postingAvailabilityPromise = Promise<StoriesUploadAvailability>()
private var postingAvailabilityDisposable: Disposable?
public init(
context: AccountContext,
subject: Signal<Subject?, NoError>,

View File

@ -2432,7 +2432,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
guard let self else {
return
}
Queue.mainQueue().after(0.1) {
Queue.mainQueue().after(0.05) {
self.openStorySharing(messages: messages)
}
}