mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
toggle history record on page reload for all routes
This commit is contained in:
parent
983fa3b3b4
commit
3a767cec56
1 changed files with 10 additions and 11 deletions
|
|
@ -381,6 +381,16 @@ impl Page {
|
|||
let navigation = self.navigation.clone();
|
||||
let url = uri.clone().to_str();
|
||||
|
||||
// Add history record
|
||||
match navigation.history_current() {
|
||||
Some(current) => {
|
||||
if current != url {
|
||||
navigation.history_add(url.clone());
|
||||
}
|
||||
}
|
||||
None => navigation.history_add(url.clone()),
|
||||
}
|
||||
|
||||
// Init socket
|
||||
let client = SocketClient::new();
|
||||
|
||||
|
|
@ -432,17 +442,6 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue