Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiznokes committed Jul 29, 2023
1 parent 0a8d364 commit ba47d22
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,24 @@ impl Application for State {

fn update(&mut self, message: Self::Message) -> iced::Command<Self::Message> {
match self {
State::Loading => {}
State::Loading => {
if let AppMsg::ProxyReceived(proxy) = message {
*self = State::Loaded(App::new(proxy))
}
}
State::Loaded(app) => match message {
AppMsg::OnInput(input) => {
app.path = input;

Check failure on line 72 in examples/proxy/src/main.rs

View workflow job for this annotation

GitHub Actions / all

Diff in /home/runner/work/iced/iced/examples/proxy/src/main.rs
}
AppMsg::OnSubmit => {
app.explorer = Explorer::new(PathBuf::from(app.path.clone()));
app.explorer = Explorer::new(PathBuf::from(app.path.clone()), app.proxy.clone());
}
AppMsg::ProxyReceived(proxy) => *self = State::Loaded(App::new(proxy)),
AppMsg::Event(e) => {
if let Some(explorer) = &mut app.explorer {
explorer.process_event(e);
}
}
_ => {}
},
}

Expand Down

0 comments on commit ba47d22

Please sign in to comment.