chore: update gpui

This commit is contained in:
2025-03-25 20:53:22 +07:00
parent 4c9533bfe4
commit 42d6328d82
28 changed files with 255 additions and 211 deletions

View File

@@ -1,8 +1,8 @@
[package]
name = "chats"
version = "0.0.0"
edition = "2021"
publish = false
edition.workspace = true
publish.workspace = true
[dependencies]
common = { path = "../common" }

View File

@@ -73,10 +73,10 @@ impl ChatRegistry {
Ok(result)
});
cx.spawn(|this, cx| async move {
cx.spawn(async move |this, cx| {
if let Ok(events) = task.await {
_ = cx.update(|cx| {
_ = this.update(cx, |this, cx| {
cx.update(|cx| {
this.update(cx, |this, cx| {
if !events.is_empty() {
let current_ids = this.current_rooms_ids(cx);
let items: Vec<Entity<Room>> = events
@@ -93,7 +93,6 @@ impl ChatRegistry {
.collect();
this.is_loading = false;
this.rooms.extend(items);
this.rooms
.sort_by_key(|room| Reverse(room.read(cx).last_seen()));
@@ -102,8 +101,10 @@ impl ChatRegistry {
}
cx.notify();
});
});
})
.ok();
})
.ok();
}
})
.detach();

View File

@@ -44,7 +44,7 @@ impl Room {
// Create a task for loading metadata
let load_metadata = Self::load_metadata(event, cx);
let room = cx.new(|cx| {
cx.new(|cx| {
let this = Self {
id,
last_seen,
@@ -52,7 +52,7 @@ impl Room {
members: smallvec![],
};
cx.spawn(|this, cx| async move {
cx.spawn(async move |this, cx| {
if let Ok(profiles) = load_metadata.await {
_ = cx.update(|cx| {
_ = this.update(cx, |this: &mut Room, cx| {
@@ -82,9 +82,7 @@ impl Room {
.detach();
this
});
room
})
}
pub fn id(&self) -> u64 {