Merge branch 'DioxusLabs:master' into master

This commit is contained in:
WIGGLES authored and GitHub committed 2022-04-20 16:50:39 -04:00
commit d6a4a59035
7 files changed
+449 -11

No files matched your search

@@ -65,8 +65,10 @@ pub async fn connect(ws: WebSocket, pool: LocalPoolHandle, app: fn(Scope) -> Ele
Either::Left((l, _)) => {
if let Some(Ok(msg)) = l {
if let Ok(Some(msg)) = msg.to_str().map(events::parse_ipc_message) {
let user_event = events::trigger_from_serialized(msg.params);
event_tx.send(user_event).unwrap();
if msg.method == "user_event" {
let user_event = events::trigger_from_serialized(msg.params);
event_tx.send(user_event).unwrap();
}
} else {
break;
}
+2 -3
View File
@@ -31,14 +31,13 @@ pub struct Liveview {
}
impl Liveview {
pub fn body(&self) -> String {
pub fn body(&self, header: &str) -> String {
format!(
r#"
<!DOCTYPE html>
<html>
<head>
<title>Dioxus app</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{header}
</head>
<body>
<div id="main"></div>