ios: allow to reply in another chat without losing draft
This commit is contained in:
@@ -76,20 +76,12 @@ struct ChatView: View {
|
||||
.onChange(of: chatModel.chatId) { _ in
|
||||
if chatModel.chatId == nil { dismiss() }
|
||||
}
|
||||
.onChange(of: "\(composeState.empty) \(composeState.noPreview) \(composeState.message)") { _ in
|
||||
if !composeState.empty {
|
||||
chatModel.draft = composeState
|
||||
chatModel.draftChatId = chat.id
|
||||
} else if chatModel.draftChatId == chat.id {
|
||||
chatModel.draft = nil
|
||||
chatModel.draftChatId = nil
|
||||
}
|
||||
}
|
||||
.onDisappear {
|
||||
if chatModel.chatId == cInfo.id {
|
||||
chatModel.chatId = nil
|
||||
if chatModel.draftChatId == cInfo.id {
|
||||
if !composeState.empty {
|
||||
chatModel.draft = composeState
|
||||
chatModel.draftChatId = chat.id
|
||||
}
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) {
|
||||
if chatModel.chatId == nil {
|
||||
|
||||
Reference in New Issue
Block a user