mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
deactivate send button on empty input
This commit is contained in:
parent
ce9695f2d0
commit
f3a2a31872
2 changed files with 10 additions and 7 deletions
|
|
@ -36,11 +36,11 @@ impl Control {
|
|||
}
|
||||
|
||||
// Actions
|
||||
pub fn update(&self, bytes_left: Option<usize>) {
|
||||
pub fn update(&self, is_empty: bool, bytes_left: Option<usize>) {
|
||||
// Update children components
|
||||
self.counter.update(bytes_left);
|
||||
self.send.update(match bytes_left {
|
||||
Some(left) => left > 0,
|
||||
Some(left) => !is_empty && left > 0,
|
||||
None => false,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue