File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed 
crates/matrix-sdk-ui/src/timeline/controller Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,23 @@ impl TimelineState {
9797            return ; 
9898        } 
9999
100+         let  previous_number_of_items = self . items . len ( ) ; 
101+ 
100102        let  mut  transaction = self . transaction ( ) ; 
101103        transaction. handle_remote_events_with_diffs ( diffs,  origin,  room_data,  settings) . await ; 
102104        transaction. commit ( ) ; 
105+ 
106+         let  next_number_of_items = self . items . len ( ) ; 
107+ 
108+         // Calculate the new count value for the `Skip` stream, used by the `Timeline` 
109+         // subscriber. 
110+         let  count = self 
111+             . meta 
112+             . subscriber_skip_count 
113+             . compute_next ( previous_number_of_items,  next_number_of_items) ; 
114+ 
115+         // Update the count value for the `Skip` stream. 
116+         self . meta . subscriber_skip_count . update ( count,  & self . timeline_focus ) ; 
103117    } 
104118
105119    /// Marks the given event as fully read, using the read marker received from 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments