Added pull message

This commit is contained in:
Abdelilah El Aissaoui 2023-05-02 19:56:12 +02:00
parent b4391880ac
commit 7df6381813
No known key found for this signature in database
GPG Key ID: 7587FC860F594869
2 changed files with 5 additions and 2 deletions

View File

@ -74,6 +74,7 @@ class TabState @Inject constructor(
// migrate the code that uses this function
title: String = "",
subtitle: String = "",
// TODO For now have it always as false because the data refresh is cancelled even when the git process couldn't be cancelled
isCancellable: Boolean = false,
refreshEvenIfCrashes: Boolean = false,
refreshEvenIfCrashesInteractive: ((Exception) -> Boolean)? = null,

View File

@ -29,6 +29,8 @@ class MenuViewModel @Inject constructor(
fun pull(pullType: PullType) = tabState.safeProcessing(
refreshType = RefreshType.ALL_DATA,
refreshEvenIfCrashes = true,
title = "Pulling",
subtitle = "Pulling changes from the remote branch to the current branch"
) { git ->
pullBranchUseCase(git, pullType)
}
@ -38,7 +40,7 @@ class MenuViewModel @Inject constructor(
refreshEvenIfCrashes = true,
title = "Fetching",
subtitle = "Updating references from the remote repositories...",
isCancellable = true
isCancellable = false
) { git ->
fetchAllBranchesUseCase(git)
}
@ -48,7 +50,7 @@ class MenuViewModel @Inject constructor(
refreshEvenIfCrashes = true,
title = "Push",
subtitle = "Pushing current branch to the remote repository",
isCancellable = true,
isCancellable = false,
) { git ->
pushBranchUseCase(git, force, pushTags)
}