handle liveview sockets disconnecting

This commit is contained in:
Evan Almloff committed 2023-01-11 14:59:00 -06:00
1 parent e5e1abbdac
commit 1b53d4585e
2 files changed
+49 -8

No files matched your search

+3 -1
View File
@@ -17,7 +17,9 @@ pub(crate) fn init(proxy: UnboundedSender<Template<'static>>) {
Ok(_) => {
let template: Template<'static> =
serde_json::from_str(Box::leak(buf.into_boxed_str())).unwrap();
proxy.send(template).unwrap();
if proxy.send(template).is_err() {
return;
}
}
Err(err) => {
if err.kind() != std::io::ErrorKind::WouldBlock {