Commit 6e9e2ba0 authored by Eugene Shapovalov's avatar Eugene Shapovalov 💬

Move NoBranchesError message from global to local handling.

parent 2a57b114
......@@ -15,7 +15,6 @@ import ru.terrakok.gitlabclient.entity.app.target.TargetHeaderTitle
import ru.terrakok.gitlabclient.entity.event.EventAction
import ru.terrakok.gitlabclient.entity.todo.TodoAction
import ru.terrakok.gitlabclient.model.system.ResourceManager
import ru.terrakok.gitlabclient.presentation.project.files.NoBranchesError
import java.io.IOException
/**
......@@ -36,7 +35,6 @@ fun Throwable.userMessage(resourceManager: ResourceManager) = when (this) {
else -> resourceManager.getString(R.string.unknown_error)
}
is IOException -> resourceManager.getString(R.string.network_error)
is NoBranchesError -> resourceManager.getString(R.string.project_files_no_branches)
else -> resourceManager.getString(R.string.unknown_error)
}
......
......@@ -132,7 +132,11 @@ class ProjectFilesPresenter @Inject constructor(
private fun handleLoadingProjectDetailsError(error: Throwable) {
viewState.setPath(resourceManager.getString(R.string.project_files_default_path))
viewState.showBranchSelection(false)
errorHandler.proceed(error, { viewState.showEmptyError(true, it) })
if (error is NoBranchesError) {
viewState.showEmptyError(true, resourceManager.getString(R.string.project_files_no_branches))
} else {
errorHandler.proceed(error, { viewState.showEmptyError(true, it) })
}
}
private val paginator = Paginator(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment