Only display 'Connect anonymously' when available
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
parent
9f819454ae
commit
2ca51132d5
1 changed files with 22 additions and 14 deletions
16
src/app.rs
16
src/app.rs
|
|
@ -3744,7 +3744,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))
|
||||||
|
|
@ -3753,8 +3754,11 @@ 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(
|
|
||||||
|
if let Some(_anonymous) = &auth.anonymous_opt {
|
||||||
|
widget = widget.tertiary_action(
|
||||||
|
widget::button::text(fl!("connect-anonymously")).on_press(
|
||||||
Message::DialogUpdateComplete(DialogPage::NetworkAuth {
|
Message::DialogUpdateComplete(DialogPage::NetworkAuth {
|
||||||
mounter_key: *mounter_key,
|
mounter_key: *mounter_key,
|
||||||
uri: uri.clone(),
|
uri: uri.clone(),
|
||||||
|
|
@ -3764,7 +3768,11 @@ impl Application for App {
|
||||||
},
|
},
|
||||||
auth_tx: auth_tx.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