mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-01 23:51:46 -04:00
Fix document reloading with delete-then-write editors and redo BottomMessage updating to work better
This commit is contained in:
@@ -94,6 +94,7 @@ async fn render_all_files(path: &'static str) -> Vec<PageInfo> {
|
||||
|
||||
while let Some(info) = from_render_rx.next().await {
|
||||
match info.expect("Renderer ran into an error while rendering") {
|
||||
RenderInfo::Reloaded => (),
|
||||
RenderInfo::NumPages(num) => fill_default(&mut pages, num),
|
||||
RenderInfo::Page(page) => {
|
||||
let num = page.page;
|
||||
|
||||
@@ -21,6 +21,8 @@ pub fn handle_renderer_msg(
|
||||
to_converter_tx.send(ConverterMsg::NumPages(num)).unwrap();
|
||||
}
|
||||
Ok(RenderInfo::Page(info)) => to_converter_tx.send(ConverterMsg::AddImg(info)).unwrap(),
|
||||
// We can ignore the `Reloaded` variant 'cause that's only used to send info to the TUI
|
||||
Ok(RenderInfo::Reloaded) => (),
|
||||
Err(e) => panic!("Got error from renderer: {e:?}")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user