remove scope cancelation for handleChatOnBackPress (replace with lifecyle event)
handleOnStop will handle this (and more scenarios than just backpress) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Родитель
1f105d44d3
Коммит
9b6b01254a
|
@ -348,7 +348,6 @@ class ChatActivity :
|
|||
|
||||
private val onBackPressedCallback = object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
chatViewModel.handleChatOnBackPress()
|
||||
if (currentlyPlayedVoiceMessage != null) {
|
||||
stopMediaPlayer(currentlyPlayedVoiceMessage!!)
|
||||
}
|
||||
|
|
|
@ -74,11 +74,6 @@ interface ChatMessageRepository : LifecycleAwareManager {
|
|||
*/
|
||||
suspend fun getMessage(messageId: Long, bundle: Bundle): Flow<ChatMessage>
|
||||
|
||||
/**
|
||||
* Destroys unused resources.
|
||||
*/
|
||||
fun handleChatOnBackPress()
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
suspend fun sendChatMessage(
|
||||
credentials: String,
|
||||
|
|
|
@ -806,10 +806,6 @@ class OfflineFirstChatRepository @Inject constructor(
|
|||
scope.cancel()
|
||||
}
|
||||
|
||||
override fun handleChatOnBackPress() {
|
||||
scope.cancel()
|
||||
}
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
override suspend fun sendChatMessage(
|
||||
credentials: String,
|
||||
|
|
|
@ -647,10 +647,6 @@ class ChatViewModel @Inject constructor(
|
|||
_getCapabilitiesViewState.value = GetCapabilitiesStartState
|
||||
}
|
||||
|
||||
fun handleChatOnBackPress() {
|
||||
chatRepository.handleChatOnBackPress()
|
||||
}
|
||||
|
||||
fun getMessageById(url: String, conversationModel: ConversationModel, messageId: Long): Flow<ChatMessage> =
|
||||
flow {
|
||||
val bundle = Bundle()
|
||||
|
|
Загрузка…
Ссылка в новой задаче