mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-30 11:46:20 +03:00
fix status_tree not showing while first status loading
This commit is contained in:
parent
3667db37e1
commit
3fee481e8d
@ -320,7 +320,21 @@ impl Component for ChangesComponent {
|
||||
fn focused(&self) -> bool {
|
||||
self.files.focused()
|
||||
}
|
||||
|
||||
fn focus(&mut self, focus: bool) {
|
||||
self.files.focus(focus);
|
||||
}
|
||||
|
||||
fn is_visible(&self) -> bool {
|
||||
self.files.is_visible()
|
||||
}
|
||||
|
||||
fn hide(&mut self) {
|
||||
self.files.hide();
|
||||
}
|
||||
|
||||
fn show(&mut self) -> Result<()> {
|
||||
self.files.show()?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +70,7 @@ impl StatusTreeComponent {
|
||||
///
|
||||
pub fn update(&mut self, list: &[StatusItem]) -> Result<()> {
|
||||
self.pending = false;
|
||||
|
||||
let new_hash = hash(list);
|
||||
if self.current_hash != new_hash {
|
||||
self.tree.update(list)?;
|
||||
@ -373,6 +374,7 @@ impl DrawableComponent for StatusTreeComponent {
|
||||
)
|
||||
})
|
||||
.skip(self.scroll_top.get());
|
||||
|
||||
ui::draw_list(
|
||||
f,
|
||||
r,
|
||||
|
@ -427,6 +427,7 @@ impl Status {
|
||||
}
|
||||
|
||||
fn check_remotes(&mut self) {
|
||||
//TODO: make get_branches_info async
|
||||
self.has_remotes =
|
||||
sync::get_branches_info(&self.repo.borrow(), false)
|
||||
.map(|branches| !branches.is_empty())
|
||||
@ -965,10 +966,16 @@ impl Component for Status {
|
||||
|
||||
fn hide(&mut self) {
|
||||
self.visible = false;
|
||||
|
||||
self.index.hide();
|
||||
self.index_wd.hide();
|
||||
}
|
||||
|
||||
fn show(&mut self) -> Result<()> {
|
||||
self.visible = true;
|
||||
self.index.show()?;
|
||||
self.index_wd.show()?;
|
||||
|
||||
self.check_remotes();
|
||||
self.update()?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user