working chat!
This commit is contained in:
+4
-3
@@ -14,6 +14,7 @@ pub enum ConnectionState {
|
||||
Connected,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Command {
|
||||
Connect {
|
||||
address: String,
|
||||
@@ -106,9 +107,9 @@ pub fn Channel(id: ChannelId) -> Element {
|
||||
|
||||
#[component]
|
||||
pub fn ChatView() -> Element {
|
||||
let net: Coroutine<Command> = use_coroutine_handle();
|
||||
let server = STATE.server.read();
|
||||
let mut draft = use_signal(|| "".to_string());
|
||||
//let net: Coroutine<Command> = use_coroutine_handle();
|
||||
rsx!(
|
||||
div {
|
||||
style: "margin: 16px; padding: 16px; border: solid black 1px;",
|
||||
@@ -132,12 +133,12 @@ pub fn ChatView() -> Element {
|
||||
}
|
||||
button {
|
||||
onclick: move |_| {
|
||||
/*if let Some(user) = server.this_user() {
|
||||
if let Some(user) = STATE.server.read().this_user() {
|
||||
net.send(SendChat {
|
||||
markdown: draft.write().split_off(0),
|
||||
channels: vec![user.channel],
|
||||
});
|
||||
}*/
|
||||
}
|
||||
},
|
||||
"Send"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user