Fix video transcription text update

This commit is contained in:
Ilya Laktyushin
2022-10-22 16:11:32 +03:00
parent fc2a32678b
commit d9fb54b67f
3 changed files with 26 additions and 10 deletions

View File

@@ -32,7 +32,7 @@ private struct FetchControls {
let cancel: () -> Void
}
enum TranscribedText {
enum TranscribedText: Equatable {
case success(text: String, isPending: Bool)
case error(AudioTranscriptionMessageAttribute.TranscriptionError)
}
@@ -199,7 +199,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
var requestUpdateLayout: (Bool) -> Void = { _ in }
var displayImportedTooltip: (ASDisplayNode) -> Void = { _ in }
var updateTranscribeExpanded: ((AudioTranscriptionButtonComponent.TranscriptionState) -> Void)?
var updateTranscriptionExpanded: ((AudioTranscriptionButtonComponent.TranscriptionState) -> Void)?
private var context: AccountContext?
private var message: Message?
@@ -447,7 +447,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
self.audioTranscriptionState = .collapsed
self.isWaitingForCollapse = true
self.requestUpdateLayout(true)
self.updateTranscribeExpanded?(self.audioTranscriptionState)
self.updateTranscriptionExpanded?(self.audioTranscriptionState)
case .collapsed:
self.audioTranscriptionState = .inProgress
self.requestUpdateLayout(true)