diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 2be8c4c7..6e969ec2 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -974,12 +974,18 @@ pub fn migrate(tx: &Transaction) -> Result<(), String> { /// /// * this feature may be improved and moved outside @TODO fn uri_to_title(uri: &Uri) -> GString { - match uri.path().split('/').last() { - Some(filename) => gformat!("{filename}"), - None => match uri.host() { + let title = GString::from(match uri.path().split('/').last() { + Some(filename) => filename, + None => "", + }); + + if title.is_empty() { + match uri.host() { Some(host) => gformat!("{host}"), None => gformat!("Untitled"), - }, + } + } else { + title } }