From 94be23b8728f3f9ec632256247e9ee256ef82509 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Thu, 27 Oct 2022 13:04:02 +0200 Subject: [PATCH] Fixed uncommited changes line not refreshing in log changed "open repo" string --- .../kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt | 2 +- .../com/jetpackduba/gitnuro/viewmodels/LogViewModel.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt index b34f037..70d40fd 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt @@ -304,7 +304,7 @@ fun MainContentView( .background(MaterialTheme.colors.onBackgroundSecondary.copy(alpha = 0.2f)) ) } - SidePanelOption("Open repository", "open.svg") { openRepositoryDialog(tabViewModel = tabViewModel) } + SidePanelOption("Open another repository", "open.svg") { openRepositoryDialog(tabViewModel = tabViewModel) } SidePanelOption("Refresh", "refresh.svg") { tabViewModel.refreshAll() } SidePanelOption("Settings", "settings.svg", onShowSettingsDialog) } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/LogViewModel.kt b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/LogViewModel.kt index 200a72c..9c45575 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/LogViewModel.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/LogViewModel.kt @@ -114,9 +114,13 @@ class LogViewModel @Inject constructor( tabState.refreshFlowFiltered( RefreshType.ALL_DATA, RefreshType.ONLY_LOG, + RefreshType.UNCOMMITED_CHANGES, RefreshType.UNCOMMITED_CHANGES_AND_LOG, - ) { - refresh(tabState.git) + ) { refreshType -> + if (refreshType == RefreshType.UNCOMMITED_CHANGES) { + uncommitedChangesLoadLog(tabState.git) + } else + refresh(tabState.git) } } }