mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Video avatar fixes
This commit is contained in:
@@ -367,10 +367,8 @@ public func createChannelController(context: AccountContext) -> ViewController {
|
||||
context.account.postbox.mediaBox.storeResourceData(photoResource.id, data: data)
|
||||
}
|
||||
|
||||
updateState { state in
|
||||
var state = state
|
||||
state.avatar = .image(representation, false)
|
||||
return state
|
||||
if let timestamp = videoStartTimestamp {
|
||||
videoStartTimestamp = max(0.0, min(timestamp, result.duration))
|
||||
}
|
||||
|
||||
var value = stat()
|
||||
@@ -413,6 +411,14 @@ public func createChannelController(context: AccountContext) -> ViewController {
|
||||
} else {
|
||||
return .single(nil)
|
||||
}
|
||||
} |> afterNext { next in
|
||||
if let next = next, next.isCompleted {
|
||||
updateState { state in
|
||||
var state = state
|
||||
state.avatar = .image(representation, false)
|
||||
return state
|
||||
}
|
||||
}
|
||||
})
|
||||
uploadedVideoAvatar = (promise, videoStartTimestamp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user