mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
add history record for all status routes
This commit is contained in:
parent
e6de0af133
commit
27149f5756
1 changed files with 11 additions and 23 deletions
|
|
@ -428,6 +428,17 @@ impl Page {
|
|||
move |result| match result
|
||||
{
|
||||
Ok(header) => {
|
||||
// Add history record
|
||||
let request = uri.to_str();
|
||||
match navigation.history_current() {
|
||||
Some(current) => {
|
||||
if current != request {
|
||||
navigation.history_add(request);
|
||||
}
|
||||
}
|
||||
None => navigation.history_add(request),
|
||||
}
|
||||
|
||||
// Route by status
|
||||
match header.status() {
|
||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#input-expected
|
||||
|
|
@ -489,18 +500,6 @@ impl Page {
|
|||
}
|
||||
);
|
||||
|
||||
// Add new history record
|
||||
let request = uri.to_str();
|
||||
|
||||
match navigation.history_current() {
|
||||
Some(current) => {
|
||||
if current != request {
|
||||
navigation.history_add(request);
|
||||
}
|
||||
}
|
||||
None => navigation.history_add(request),
|
||||
}
|
||||
|
||||
// Update window components
|
||||
action_update.activate(Some(&id));
|
||||
}
|
||||
|
|
@ -551,17 +550,6 @@ impl Page {
|
|||
// Update page content
|
||||
content.set_image(&buffer);
|
||||
|
||||
// Add history record
|
||||
let request = uri.to_str();
|
||||
match navigation.history_current() {
|
||||
Some(current) => {
|
||||
if current != request {
|
||||
navigation.history_add(request);
|
||||
}
|
||||
}
|
||||
None => navigation.history_add(request),
|
||||
}
|
||||
|
||||
// Update window components
|
||||
action_update.activate(Some(&id));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue