diff options
author | 2020-03-23 21:08:03 +0100 | |
---|---|---|
committer | 2020-03-23 21:08:03 +0100 | |
commit | 8e0dcd212d71ff334aa590ee3b565da7b8d24713 (patch) | |
tree | 3802215b31cdc71749ae7ae6eda948fffa1b2fba /examples/download_progress | |
parent | 8e073d10d71f80077b843c49013a8bdfeb5a7f44 (diff) | |
download | iced-8e0dcd212d71ff334aa590ee3b565da7b8d24713.tar.gz iced-8e0dcd212d71ff334aa590ee3b565da7b8d24713.tar.bz2 iced-8e0dcd212d71ff334aa590ee3b565da7b8d24713.zip |
Fix retry button on `download_progress` example
Diffstat (limited to 'examples/download_progress')
-rw-r--r-- | examples/download_progress/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/download_progress/src/main.rs b/examples/download_progress/src/main.rs index 817a45ac..6c3094f7 100644 --- a/examples/download_progress/src/main.rs +++ b/examples/download_progress/src/main.rs @@ -19,8 +19,8 @@ enum Example { #[derive(Debug, Clone)] pub enum Message { - DownloadProgressed(download::Progress), Download, + DownloadProgressed(download::Progress), } impl Application for Example { @@ -43,7 +43,9 @@ impl Application for Example { fn update(&mut self, message: Message) -> Command<Message> { match message { Message::Download => match self { - Example::Idle { .. } | Example::Finished { .. } => { + Example::Idle { .. } + | Example::Finished { .. } + | Example::Errored { .. } => { *self = Example::Downloading { progress: 0.0 }; } _ => {} |