Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
tevincent committed Aug 13, 2024
1 parent 5cbdb5a commit 7b78a6c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class MainViewModel @Inject constructor(
.stateIn(
scope = viewModelScope,
started = SharingStarted.Eagerly,
initialValue = null
initialValue = null,
)

private var currentThreadsLiveJob: Job? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ class DownloadAttachmentProgressDialog : DialogFragment() {
}

private fun popBackStackWithError() {
// We have to use the Flow instead of the LiveData here since the mainViewModel is not the same instance as the one in the
// MainActivity. So, instead of observing the LiveData in order to make it "active", we use the Flow.
viewLifecycleOwner.lifecycleScope.launch {
mainViewModel.isNetworkAvailable.first { it != null }?.let { isNetworkAvailable ->
val title = if (isNetworkAvailable) R.string.anErrorHasOccurred else R.string.noConnection
Expand Down

0 comments on commit 7b78a6c

Please sign in to comment.