Video avatar fixes

This commit is contained in:
Ilya Laktyushin
2020-07-10 15:41:51 +03:00
parent 688d692993
commit ab41dbe22a
10 changed files with 104 additions and 64 deletions

View File

@@ -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)
}