diff --git a/changelog.d/4602.misc b/changelog.d/4602.misc new file mode 100644 index 0000000000..7f6271242a --- /dev/null +++ b/changelog.d/4602.misc @@ -0,0 +1 @@ +There is no need to call job.cancel() when we are using viewModelScope() diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt index a360b91085..7bff76cc36 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/search/SearchViewModel.kt @@ -141,9 +141,4 @@ class SearchViewModel @AssistedInject constructor( ) } } - - override fun onCleared() { - currentTask?.cancel() - super.onCleared() - } } diff --git a/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt b/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt index 844266e668..431dba21cf 100644 --- a/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomdirectory/RoomDirectoryViewModel.kt @@ -231,9 +231,4 @@ class RoomDirectoryViewModel @AssistedInject constructor( } } } - - override fun onCleared() { - currentJob?.cancel() - super.onCleared() - } }