mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +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 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…
Add table
Add a link
Reference in a new issue