hide input forms on handle begin

This commit is contained in:
yggverse 2025-01-26 11:49:12 +02:00
parent 0023f6f299
commit 9ba99417ae

View file

@ -175,7 +175,13 @@ fn handle(
{ {
let subject = subject.clone(); let subject = subject.clone();
let redirects = redirects.clone(); let redirects = redirects.clone();
move |result| match result { move |result| {
// Remove input forms when redirection expected has been not applied (e.g. failure status)
// @TODO implement input data recovery on error (it's also available before unset, but reference lost at this point)
subject.page.input.unset();
// Begin result handle
match result {
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
@ -502,6 +508,7 @@ fn handle(
redirects.replace(0); // reset redirects.replace(0); // reset
} }
} }
}
}, },
) )
} }