mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
merge input construction
This commit is contained in:
parent
bfbe2a930d
commit
8974f6bc27
1 changed files with 17 additions and 22 deletions
|
|
@ -129,32 +129,27 @@ impl Gemini {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
match response.meta.status {
|
match response.meta.status {
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#input-expected
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#input-expected
|
||||||
Status::Input => {
|
Status::Input | Status::SensitiveInput => {
|
||||||
let title = match response.meta.data {
|
let title = match response.meta.data {
|
||||||
Some(data) => data.to_string(),
|
Some(data) => data.to_string(),
|
||||||
None => Status::Input.to_string(),
|
None => Status::Input.to_string(),
|
||||||
};
|
};
|
||||||
page.input.set_new_response(
|
if matches!(response.meta.status, Status::SensitiveInput) {
|
||||||
page.tab_action.clone(),
|
page.input.set_new_sensitive(
|
||||||
uri,
|
page.tab_action.clone(),
|
||||||
Some(&title),
|
uri,
|
||||||
Some(1024),
|
Some(&title),
|
||||||
);
|
Some(1024),
|
||||||
page.title.replace(title.into()); // @TODO
|
);
|
||||||
page.browser_action.update.activate(Some(&page.id));
|
} else {
|
||||||
}
|
page.input.set_new_response(
|
||||||
Status::SensitiveInput => {
|
page.tab_action.clone(),
|
||||||
let title = match response.meta.data {
|
uri,
|
||||||
Some(data) => data.to_string(),
|
Some(&title),
|
||||||
None => Status::Input.to_string(),
|
Some(1024),
|
||||||
};
|
);
|
||||||
page.input.set_new_sensitive(
|
}
|
||||||
page.tab_action.clone(),
|
page.title.replace(title.into());
|
||||||
uri,
|
|
||||||
Some(&title),
|
|
||||||
Some(1024),
|
|
||||||
);
|
|
||||||
page.title.replace(title.into()); // @TODO
|
|
||||||
page.browser_action.update.activate(Some(&page.id));
|
page.browser_action.update.activate(Some(&page.id));
|
||||||
}
|
}
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-20
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-20
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue