Skip to content

Commit a98789f

Browse files
Fixed a bug with canceled backswipe
1 parent b0f486d commit a98789f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
139139
.onChange(of: presentationMode.wrappedValue, perform: { newValue in
140140
if newValue.isPresented == false {
141141
viewModel.onViewDissappear()
142+
} else {
143+
viewModel.setActive()
142144
}
143145
})
144146
.background(

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ open class ChatChannelViewModel: ObservableObject, MessagesDataSource {
216216
}
217217

218218
public func onViewAppear() {
219-
isActive = true
219+
setActive()
220220
messages = channelDataSource.messages
221221
checkNameChange()
222222
}
@@ -225,6 +225,10 @@ open class ChatChannelViewModel: ObservableObject, MessagesDataSource {
225225
isActive = false
226226
}
227227

228+
public func setActive() {
229+
isActive = true
230+
}
231+
228232
// MARK: - private
229233

230234
private func checkForNewMessages(index: Int) {

0 commit comments

Comments
 (0)