Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-08-29 23:21:55 +03:00
parent 0c9eb7006c
commit 23ec6672c1
14 changed files with 95 additions and 10 deletions

View File

@@ -858,6 +858,8 @@ public final class VoiceChatController: ViewController {
private var currentLoadToken: String?
private var scrollAtTop = true
private var effectiveMuteState: GroupCallParticipantsContext.Participant.MuteState? {
if self.pushingToTalk {
return nil
@@ -2157,6 +2159,22 @@ public final class VoiceChatController: ViewController {
}
}
self.listNode.visibleContentOffsetChanged = { [weak self] offset in
guard let strongSelf = self else {
return
}
var scrollAtTop = false
if case let .known(value) = offset, value < 180.0 {
scrollAtTop = true
} else {
scrollAtTop = false
}
if scrollAtTop != strongSelf.scrollAtTop {
strongSelf.scrollAtTop = scrollAtTop
strongSelf.updateTitle(transition: .immediate)
}
}
self.listNode.visibleBottomContentOffsetChanged = { [weak self] offset in
guard let strongSelf = self else {
return
@@ -3939,8 +3957,15 @@ public final class VoiceChatController: ViewController {
}
}
var subtitle = self.currentSpeakingSubtitle ?? self.currentSubtitle
var speaking = self.currentSpeakingSubtitle != nil
var subtitle = ""
var speaking = false
if self.scrollAtTop {
subtitle = self.currentSubtitle
speaking = false
} else {
subtitle = self.currentSpeakingSubtitle ?? self.currentSubtitle
speaking = self.currentSpeakingSubtitle != nil
}
if self.isScheduling {
subtitle = ""
speaking = false