Fixed opening a new repository would still show info from the previous instance

This commit is contained in:
Abdelilah El Aissaoui 2022-10-29 16:42:37 +02:00
parent a7134a31dd
commit 6be8d49654

View File

@ -166,6 +166,8 @@ class TabViewModel @Inject constructor(
tabState.initGit(git) tabState.initGit(git)
onRepositoryChanged(repository.directory.parent) onRepositoryChanged(repository.directory.parent)
tabState.newSelectedItem(selectedItem = SelectedItem.UncommitedChanges)
newDiffSelected = null
refreshRepositoryInfo() refreshRepositoryInfo()
watchRepositoryChanges(git) watchRepositoryChanges(git)
@ -233,7 +235,7 @@ class TabViewModel @Inject constructor(
// Sometimes external apps can run filesystem multiple operations in a fraction of a second. // 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 // 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 currentTimeMillis = System.currentTimeMillis()
val diffTime = currentTimeMillis - lastNotify val diffTime = currentTimeMillis - lastNotify