mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various fixes
This commit is contained in:
@@ -1959,6 +1959,7 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
}
|
||||
},
|
||||
nil,
|
||||
1,
|
||||
{}
|
||||
)
|
||||
} else {
|
||||
@@ -1995,6 +1996,7 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
}
|
||||
},
|
||||
nil,
|
||||
self.controller?.remainingStoryCount,
|
||||
{}
|
||||
)
|
||||
}
|
||||
@@ -3374,7 +3376,7 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
self.transitionOut = transitionOut
|
||||
}
|
||||
}
|
||||
fileprivate let completion: (Signal<CameraScreenImpl.Result, NoError>, ResultTransition?, @escaping () -> Void) -> Void
|
||||
fileprivate let completion: (Signal<CameraScreenImpl.Result, NoError>, ResultTransition?, Int32?, @escaping () -> Void) -> Void
|
||||
public var transitionedIn: () -> Void = {}
|
||||
public var transitionedOut: () -> Void = {}
|
||||
|
||||
@@ -3382,6 +3384,7 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
|
||||
private let postingAvailabilityPromise = Promise<StoriesUploadAvailability>()
|
||||
private var postingAvailabilityDisposable: Disposable?
|
||||
private var remainingStoryCount: Int32?
|
||||
|
||||
private var codeDisposable: Disposable?
|
||||
private var resolveCodeDisposable: Disposable?
|
||||
@@ -3419,7 +3422,7 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
holder: CameraHolder? = nil,
|
||||
transitionIn: TransitionIn?,
|
||||
transitionOut: @escaping (Bool) -> TransitionOut?,
|
||||
completion: @escaping (Signal<CameraScreenImpl.Result, NoError>, ResultTransition?, @escaping () -> Void) -> Void
|
||||
completion: @escaping (Signal<CameraScreenImpl.Result, NoError>, ResultTransition?, Int32?, @escaping () -> Void) -> Void
|
||||
) {
|
||||
self.context = context
|
||||
self.mode = mode
|
||||
@@ -3473,7 +3476,7 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
return
|
||||
}
|
||||
if case let .available(remainingCount) = availability {
|
||||
let _ = remainingCount
|
||||
self.remainingStoryCount = remainingCount
|
||||
return
|
||||
}
|
||||
self.node.postingAvailable = false
|
||||
@@ -3639,7 +3642,11 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
if self.cameraState.isCollageEnabled {
|
||||
selectionLimit = 6
|
||||
} else {
|
||||
selectionLimit = 10
|
||||
if let remainingStoryCount = self.remainingStoryCount {
|
||||
selectionLimit = min(Int(remainingStoryCount), 10)
|
||||
} else {
|
||||
selectionLimit = 10
|
||||
}
|
||||
}
|
||||
}
|
||||
controller = self.context.sharedContext.makeStoryMediaPickerScreen(
|
||||
@@ -3704,10 +3711,10 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
)
|
||||
self.present(alertController, in: .window(.root))
|
||||
} else {
|
||||
self.completion(.single(.asset(asset)), resultTransition, dismissed)
|
||||
self.completion(.single(.asset(asset)), resultTransition, self.remainingStoryCount, dismissed)
|
||||
}
|
||||
} else if let draft = result as? MediaEditorDraft {
|
||||
self.completion(.single(.draft(draft)), resultTransition, dismissed)
|
||||
self.completion(.single(.draft(draft)), resultTransition, self.remainingStoryCount, dismissed)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3753,7 +3760,7 @@ public class CameraScreenImpl: ViewController, CameraScreen {
|
||||
}
|
||||
} else {
|
||||
if let assets = results as? [PHAsset] {
|
||||
self.completion(.single(.assets(assets)), nil, {
|
||||
self.completion(.single(.assets(assets)), nil, self.remainingStoryCount, {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user