wip: refactor

This commit is contained in:
2025-01-08 12:34:13 +07:00
parent fe24f84b02
commit 122ee4c8bb
13 changed files with 360 additions and 271 deletions

View File

@@ -15,10 +15,7 @@ use ui::{
use super::message::RoomMessage;
use crate::{
get_client,
states::{
account::AccountRegistry,
chat::{ChatRegistry, Room},
},
states::chat::{ChatRegistry, Room},
};
#[derive(Clone)]
@@ -202,7 +199,6 @@ impl RoomPanel {
fn send_message(&mut self, cx: &mut ViewContext<Self>) {
let owner = self.owner;
let current_user = cx.global::<AccountRegistry>().get().unwrap();
let content = self.input.read(cx).text().to_string();
let content2 = content.clone();
let content3 = content2.clone();
@@ -216,6 +212,14 @@ impl RoomPanel {
let client = get_client();
async move {
let current_user = async_cx
.background_executor()
.spawn(async move {
let signer = client.signer().await.unwrap();
signer.get_public_key().await.unwrap()
})
.await;
// Send message to all members
async_cx
.background_executor()