fix
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m38s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m27s

This commit is contained in:
2026-02-11 16:08:22 +07:00
parent 0581cd2969
commit 9380288fc1
2 changed files with 34 additions and 34 deletions

View File

@@ -333,18 +333,17 @@ impl ChatRegistry {
/// Emit an open room event.
///
/// If the room is new, add it to the registry.
pub fn emit_room(&mut self, room: WeakEntity<Room>, cx: &mut Context<Self>) {
if let Some(room) = room.upgrade() {
let id = room.read(cx).id;
pub fn emit_room(&mut self, room: &Entity<Room>, cx: &mut Context<Self>) {
// Get the room's ID.
let id = room.read(cx).id;
// If the room is new, add it to the registry.
if !self.rooms.iter().any(|r| r.read(cx).id == id) {
self.rooms.insert(0, room);
}
// Emit the open room event.
cx.emit(ChatEvent::OpenRoom(id));
// If the room is new, add it to the registry.
if !self.rooms.iter().any(|r| r.read(cx).id == id) {
self.rooms.insert(0, room.to_owned());
}
// Emit the open room event.
cx.emit(ChatEvent::OpenRoom(id));
}
/// Close a room.