From 3a767cec564d81d25fe643daa0626f9a595ce18e Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 28 Oct 2024 16:43:31 +0200 Subject: [PATCH] toggle history record on page reload for all routes --- src/app/browser/window/tab/item/page.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index eec36118..5b20f90a 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -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