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 // migrate the code that uses this function
title: String = "", title: String = "",
subtitle: 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, isCancellable: Boolean = false,
refreshEvenIfCrashes: Boolean = false, refreshEvenIfCrashes: Boolean = false,
refreshEvenIfCrashesInteractive: ((Exception) -> Boolean)? = null, refreshEvenIfCrashesInteractive: ((Exception) -> Boolean)? = null,

View File

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