Fix retry button on download_progress
example
This commit is contained in:
parent
8e073d10d7
commit
8e0dcd212d
@ -19,8 +19,8 @@ enum Example {
|
|||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
DownloadProgressed(download::Progress),
|
|
||||||
Download,
|
Download,
|
||||||
|
DownloadProgressed(download::Progress),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Application for Example {
|
impl Application for Example {
|
||||||
@ -43,7 +43,9 @@ impl Application for Example {
|
|||||||
fn update(&mut self, message: Message) -> Command<Message> {
|
fn update(&mut self, message: Message) -> Command<Message> {
|
||||||
match message {
|
match message {
|
||||||
Message::Download => match self {
|
Message::Download => match self {
|
||||||
Example::Idle { .. } | Example::Finished { .. } => {
|
Example::Idle { .. }
|
||||||
|
| Example::Finished { .. }
|
||||||
|
| Example::Errored { .. } => {
|
||||||
*self = Example::Downloading { progress: 0.0 };
|
*self = Example::Downloading { progress: 0.0 };
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
Loading…
Reference in New Issue
Block a user