Merge pull request #719 from mkljczk/anonymous-fix
Only display 'Connect anonymously' when available
This commit is contained in:
commit
fbaf94fc94
1 changed files with 21 additions and 13 deletions
34
src/app.rs
34
src/app.rs
|
|
@ -3778,7 +3778,8 @@ impl Application for App {
|
||||||
let mut parts = auth.message.splitn(2, '\n');
|
let mut parts = auth.message.splitn(2, '\n');
|
||||||
let title = parts.next().unwrap_or_default();
|
let title = parts.next().unwrap_or_default();
|
||||||
let body = parts.next().unwrap_or_default();
|
let body = parts.next().unwrap_or_default();
|
||||||
widget::dialog()
|
|
||||||
|
let mut widget = widget::dialog()
|
||||||
.title(title)
|
.title(title)
|
||||||
.body(body)
|
.body(body)
|
||||||
.control(widget::column::with_children(controls).spacing(space_s))
|
.control(widget::column::with_children(controls).spacing(space_s))
|
||||||
|
|
@ -3787,18 +3788,25 @@ impl Application for App {
|
||||||
)
|
)
|
||||||
.secondary_action(
|
.secondary_action(
|
||||||
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
|
widget::button::standard(fl!("cancel")).on_press(Message::DialogCancel),
|
||||||
)
|
);
|
||||||
.tertiary_action(widget::button::text(fl!("connect-anonymously")).on_press(
|
|
||||||
Message::DialogUpdateComplete(DialogPage::NetworkAuth {
|
if let Some(_anonymous) = &auth.anonymous_opt {
|
||||||
mounter_key: *mounter_key,
|
widget = widget.tertiary_action(
|
||||||
uri: uri.clone(),
|
widget::button::text(fl!("connect-anonymously")).on_press(
|
||||||
auth: MounterAuth {
|
Message::DialogUpdateComplete(DialogPage::NetworkAuth {
|
||||||
anonymous_opt: Some(true),
|
mounter_key: *mounter_key,
|
||||||
..auth.clone()
|
uri: uri.clone(),
|
||||||
},
|
auth: MounterAuth {
|
||||||
auth_tx: auth_tx.clone(),
|
anonymous_opt: Some(true),
|
||||||
}),
|
..auth.clone()
|
||||||
))
|
},
|
||||||
|
auth_tx: auth_tx.clone(),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
widget
|
||||||
}
|
}
|
||||||
DialogPage::NetworkError {
|
DialogPage::NetworkError {
|
||||||
mounter_key: _,
|
mounter_key: _,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue