toggle history record on page reload for all routes

This commit is contained in:
yggverse 2024-10-28 16:43:31 +02:00
parent 983fa3b3b4
commit 3a767cec56

View File

@ -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