Skip to content

Commit

Permalink
Hide Trash icon on empty chat
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jul 20, 2024
1 parent 7a32dd7 commit bea0076
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/screen/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,18 @@ impl Conversation {
tip::Position::Right,
);

let delete = tip(
button(icon::trash().style(text::danger))
.padding(0)
.on_press(Message::Delete)
.style(button::text),
"Delete Chat",
tip::Position::Left,
);
let delete: Element<_> = if self.id.is_some() {
tip(
button(icon::trash().style(text::danger))
.padding(0)
.on_press(Message::Delete)
.style(button::text),
"Delete Chat",
tip::Position::Left,
)
} else {
horizontal_space().into()
};

let bar = stack![title, row![toggle_sidebar, horizontal_space(), delete]].into();

Expand Down

0 comments on commit bea0076

Please sign in to comment.