From 44c669389a6837b7a26050f896bd30d7dc97c96f Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 12 Dec 2024 22:41:12 +0200 Subject: [PATCH] fix home button status detection --- src/app/browser/window/tab/item/page/navigation.rs | 2 +- src/app/browser/window/tab/item/page/navigation/home.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/browser/window/tab/item/page/navigation.rs b/src/app/browser/window/tab/item/page/navigation.rs index 985ce2c8..6278be2d 100644 --- a/src/app/browser/window/tab/item/page/navigation.rs +++ b/src/app/browser/window/tab/item/page/navigation.rs @@ -72,7 +72,7 @@ impl Navigation { self.bookmark .update(self.profile.bookmark.get(&request_text).is_ok()); self.history.update(); - self.home.update(&self.request.strip_prefix()); + self.home.update(&request_text); self.reload.update(!request_text.is_empty()); self.request.update( progress_fraction, diff --git a/src/app/browser/window/tab/item/page/navigation/home.rs b/src/app/browser/window/tab/item/page/navigation/home.rs index c24a997c..d2b344b8 100644 --- a/src/app/browser/window/tab/item/page/navigation/home.rs +++ b/src/app/browser/window/tab/item/page/navigation/home.rs @@ -26,9 +26,8 @@ impl Home { pub fn update(&self, request: &str) { let has_home = match Uri::parse(request, UriFlags::NONE) { Ok(uri) => { - let has_home = "/" != uri.path(); - self.uri.replace(Some(uri)); - has_home + self.uri.replace(Some(uri.clone())); + uri.path().len() > 1 } _ => { self.uri.replace(None);