File tree 1 file changed +14
-0
lines changed
crates/matrix-sdk-ui/src/timeline/controller
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,23 @@ impl TimelineState {
97
97
return ;
98
98
}
99
99
100
+ let previous_number_of_items = self . items . len ( ) ;
101
+
100
102
let mut transaction = self . transaction ( ) ;
101
103
transaction. handle_remote_events_with_diffs ( diffs, origin, room_data, settings) . await ;
102
104
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 ) ;
103
117
}
104
118
105
119
/// 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