Fix entering thread view when there's no messages yet (#224)

This commit is contained in:
Ulyssa 2024-03-23 19:20:06 -07:00 committed by GitHub
parent 1e9b6cc271
commit 2ac71da9a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 262 additions and 238 deletions

View file

@ -21,7 +21,7 @@ use tracing::Level;
use url::Url;
use crate::{
base::{ChatStore, EventLocation, ProgramStore, RoomFetchStatus, RoomInfo},
base::{ChatStore, EventLocation, ProgramStore, RoomInfo},
config::{
user_color,
user_style_from_color,
@ -148,25 +148,11 @@ pub fn mock_messages() -> Messages {
}
pub fn mock_room() -> RoomInfo {
RoomInfo {
name: Some("Watercooler Discussion".into()),
tags: None,
keys: mock_keys(),
messages: mock_messages(),
threads: HashMap::default(),
event_receipts: HashMap::new(),
user_receipts: HashMap::new(),
reactions: HashMap::new(),
fetching: false,
fetch_id: RoomFetchStatus::NotStarted,
fetch_last: None,
users_typing: None,
display_names: HashMap::new(),
draw_last: None,
}
let mut room = RoomInfo::default();
room.name = Some("Watercooler Discussion".into());
room.keys = mock_keys();
*room.get_thread_mut(None) = mock_messages();
room
}
pub fn mock_dirs() -> DirectoryValues {