@@ -859,6 +859,8 @@ pub struct RoomScreen {
859859 #[ rust] is_loaded : bool ,
860860 /// Whether or not all rooms have been loaded (received from the homeserver).
861861 #[ rust] all_rooms_loaded : bool ,
862+ /// Whether the timeline loaded notification has been sent for the current room.
863+ #[ rust] timeline_loaded_notified : bool ,
862864}
863865impl Drop for RoomScreen {
864866 fn drop ( & mut self ) {
@@ -1331,11 +1333,12 @@ impl Widget for RoomScreen {
13311333 } ;
13321334 let room_id = & tl_state. room_id ;
13331335 let tl_items = & tl_state. items ;
1334- if !tl_items. is_empty ( ) {
1336+ if !tl_items. is_empty ( ) && ! self . timeline_loaded_notified {
13351337 // Signal waiting threads that this room's timeline has loaded and is ready to jump to specific messages.
13361338 if let Ok ( map) = ROOM_TIMELINE_LOADED_MAP . read ( ) {
13371339 if let Some ( notify) = map. get ( room_id) {
13381340 notify. notify_one ( ) ;
1341+ self . timeline_loaded_notified = true ;
13391342 }
13401343 }
13411344 }
@@ -1792,7 +1795,7 @@ impl RoomScreen {
17921795 item_id : index
17931796 } ;
17941797 } else {
1795- log ! ( "essage not found - trigger backwards pagination to find it" ) ;
1798+ log ! ( "Message not found - trigger backwards pagination to find it" ) ;
17961799 // Message not found - trigger backwards pagination to find it
17971800 loading_pane. set_state (
17981801 cx,
@@ -2625,6 +2628,8 @@ impl RoomScreen {
26252628 self . loading_pane ( id ! ( loading_pane) ) . take_state ( ) ;
26262629 self . room_name = room_name_or_id ( room_name. into ( ) , & room_id) ;
26272630 self . room_id = Some ( room_id. clone ( ) ) ;
2631+ // Reset timeline loaded notification flag for the new room
2632+ self . timeline_loaded_notified = false ;
26282633
26292634 // We initially tell every MentionableTextInput widget that the current user
26302635 // *does not* has privileges to notify the entire room;
@@ -4406,7 +4411,7 @@ impl Widget for Message {
44064411 & scope. path ,
44074412 RoomsListAction :: Selected ( target_selected_room)
44084413 ) ;
4409- submit_async_request ( MatrixRequest :: WaitForRoomTimelineDrawnToJump { room_id : jump_request. room_id . clone ( ) , event_id : jump_request. event_id . clone ( ) } ) ;
4414+ submit_async_request ( MatrixRequest :: WaitForRoomTimelineLoadedToJump { room_id : jump_request. room_id . clone ( ) , event_id : jump_request. event_id . clone ( ) } ) ;
44104415 }
44114416 }
44124417 self . view . handle_event ( cx, event, scope) ;
0 commit comments