Fix image previews in replies (#225)

This commit is contained in:
Ulyssa 2024-03-23 19:41:05 -07:00 committed by GitHub
parent 2ac71da9a6
commit d3b717d1be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 89 additions and 103 deletions

View file

@ -1292,7 +1292,6 @@ impl<'a> StatefulWidget for Scrollback<'a> {
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
let info = self.store.application.rooms.get_or_default(state.room_id.clone());
let settings = &self.store.application.settings;
let picker = &self.store.application.picker;
let area = if state.cursor.timestamp.is_some() {
render_jump_to_recent(area, buf, self.focused)
} else {
@ -1343,13 +1342,8 @@ impl<'a> StatefulWidget for Scrollback<'a> {
for (key, item) in thread.range(&corner_key..) {
let sel = key == cursor_key;
let txt = item.show(prev, foc && sel, &state.viewctx, info, settings);
let mut msg_preview = if picker.is_some() {
item.line_preview(prev, &state.viewctx, info, settings)
} else {
None
};
let (txt, mut msg_preview) =
item.show_with_preview(prev, foc && sel, &state.viewctx, info, settings);
let incomplete_ok = !full || !sel;