From 7df6381813e2dd6be4d402d77351a5c64a037a48 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Tue, 2 May 2023 19:56:12 +0200 Subject: [PATCH] Added pull message --- src/main/kotlin/com/jetpackduba/gitnuro/git/TabState.kt | 1 + .../com/jetpackduba/gitnuro/viewmodels/MenuViewModel.kt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/git/TabState.kt b/src/main/kotlin/com/jetpackduba/gitnuro/git/TabState.kt index f77f4c9..6347083 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/git/TabState.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/git/TabState.kt @@ -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, diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/MenuViewModel.kt b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/MenuViewModel.kt index 91ffef0..7645892 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/MenuViewModel.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/MenuViewModel.kt @@ -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) }