mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-10 18:34:14 +00:00
toggle history record on page reload for all routes
This commit is contained in:
parent
983fa3b3b4
commit
3a767cec56
@ -381,6 +381,16 @@ impl Page {
|
|||||||
let navigation = self.navigation.clone();
|
let navigation = self.navigation.clone();
|
||||||
let url = uri.clone().to_str();
|
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
|
// Init socket
|
||||||
let client = SocketClient::new();
|
let client = SocketClient::new();
|
||||||
|
|
||||||
@ -432,17 +442,6 @@ impl Page {
|
|||||||
move |result| match result
|
move |result| match result
|
||||||
{
|
{
|
||||||
Ok(header) => {
|
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
|
// Route by status
|
||||||
match header.status() {
|
match header.status() {
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#input-expected
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#input-expected
|
||||||
|
Loading…
x
Reference in New Issue
Block a user