File tree Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -50,18 +50,14 @@ impl CommitDetailsComponent {
50
50
}
51
51
}
52
52
53
- fn get_files_title ( & self , loading : bool ) -> String {
53
+ fn get_files_title ( & self ) -> String {
54
54
let files_count = self . file_tree . file_count ( ) ;
55
55
56
- if loading {
57
- strings:: commit:: DETAILS_FILES_LOADING_TITLE . to_string ( )
58
- } else {
59
- format ! (
60
- "{} {}" ,
61
- strings:: commit:: DETAILS_FILES_TITLE ,
62
- files_count
63
- )
64
- }
56
+ format ! (
57
+ "{} {}" ,
58
+ strings:: commit:: DETAILS_FILES_TITLE ,
59
+ files_count
60
+ )
65
61
}
66
62
67
63
///
@@ -78,19 +74,18 @@ impl CommitDetailsComponent {
78
74
{
79
75
if fetched_id == id {
80
76
self . file_tree . update ( res. as_slice ( ) ) ?;
81
- self . file_tree
82
- . set_title ( self . get_files_title ( false ) ) ;
77
+ self . file_tree . set_title ( self . get_files_title ( ) ) ;
83
78
84
79
return Ok ( ( ) ) ;
85
80
}
86
81
}
82
+
87
83
self . file_tree . clear ( ) ?;
88
84
self . git_commit_files . fetch ( id) ?;
89
- self . file_tree . set_title ( self . get_files_title ( true ) ) ;
90
- } else {
91
- self . file_tree . set_title ( self . get_files_title ( false ) ) ;
92
85
}
93
86
87
+ self . file_tree . set_title ( self . get_files_title ( ) ) ;
88
+
94
89
Ok ( ( ) )
95
90
}
96
91
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ impl FileTreeComponent {
104
104
///
105
105
pub fn clear ( & mut self ) -> Result < ( ) > {
106
106
self . current_hash = 0 ;
107
+ self . pending = true ;
107
108
self . tree . update ( & [ ] )
108
109
}
109
110
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ pub mod commit {
50
50
pub static DETAILS_INFO_TITLE : & str = "Info" ;
51
51
pub static DETAILS_MESSAGE_TITLE : & str = "Message" ;
52
52
pub static DETAILS_FILES_TITLE : & str = "Files:" ;
53
- pub static DETAILS_FILES_LOADING_TITLE : & str = "Files: loading" ;
54
53
}
55
54
56
55
pub mod order {
You can’t perform that action at this time.
0 commit comments