Increased refresh time when having multiple consecutive changes to 1s and added refresh when diff missing
This commit is contained in:
parent
c20021832f
commit
7b4ab49a30
@ -134,6 +134,10 @@ class TabState @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun refreshData(refreshType: RefreshType) {
|
||||||
|
_refreshData.emit(refreshType)
|
||||||
|
}
|
||||||
|
|
||||||
fun newSelectedStash(stash: RevCommit) {
|
fun newSelectedStash(stash: RevCommit) {
|
||||||
newSelectedItem(SelectedItem.Stash(stash))
|
newSelectedItem(SelectedItem.Stash(stash))
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ class DiffViewModel @Inject constructor(
|
|||||||
_diffResult.value = ViewDiffResult.Loaded(diffEntryType, diffFormat)
|
_diffResult.value = ViewDiffResult.Loaded(diffEntryType, diffFormat)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
if(ex is MissingDiffEntryException) {
|
if(ex is MissingDiffEntryException) {
|
||||||
|
tabState.refreshData(refreshType = RefreshType.UNCOMMITED_CHANGES)
|
||||||
_diffResult.value = ViewDiffResult.DiffNotFound
|
_diffResult.value = ViewDiffResult.DiffNotFound
|
||||||
} else
|
} else
|
||||||
ex.printStackTrace()
|
ex.printStackTrace()
|
||||||
|
@ -20,7 +20,7 @@ import org.eclipse.jgit.lib.RepositoryState
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
private const val MIN_TIME_IN_MS_BETWEEN_REFRESHES = 500L
|
private const val MIN_TIME_IN_MS_BETWEEN_REFRESHES = 1000L
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains all the information related to a tab and its subcomponents (smaller composables like the log, branches,
|
* Contains all the information related to a tab and its subcomponents (smaller composables like the log, branches,
|
||||||
|
Loading…
Reference in New Issue
Block a user