From 6be8d496540e5e1a8fbdace1ef65990770af98e6 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Sat, 29 Oct 2022 16:42:37 +0200 Subject: [PATCH] Fixed opening a new repository would still show info from the previous instance --- .../kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt index 02cc924..34225f1 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt @@ -166,6 +166,8 @@ class TabViewModel @Inject constructor( tabState.initGit(git) onRepositoryChanged(repository.directory.parent) + tabState.newSelectedItem(selectedItem = SelectedItem.UncommitedChanges) + newDiffSelected = null refreshRepositoryInfo() watchRepositoryChanges(git) @@ -233,7 +235,7 @@ class TabViewModel @Inject constructor( // Sometimes external apps can run filesystem multiple operations in a fraction of a second. // To prevent excessive updates, we add a slight delay between updates emission to prevent slowing down - // the com.jetpackduba.gitnuro.app by constantly running "git status". + // the app by constantly running "git status". val currentTimeMillis = System.currentTimeMillis() val diffTime = currentTimeMillis - lastNotify