From aa44325deac1202c73d7f8d079d60320a90affb1 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 1 Nov 2024 19:53:53 +0200 Subject: [PATCH] add unsupported status code placeholder --- src/app/browser/window/tab/item/page.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index c9561ca1..bf2745b5 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -359,7 +359,7 @@ impl Page { Ok(()) } - // Private helpers @TODO + // Private helpers @TODO move outside fn load_gemini(&self, uri: Uri) { // Use local namespaces @TODO // use gemini::client::response:: @@ -694,6 +694,26 @@ impl Page { action_update.activate(Some(&id)); }, + _ => { + // Define common data + let status = Status::Failure; + let title = gformat!("Oops"); + + // Update widget + content + .to_status_failure() + .set_title(title.as_str()) + .set_description(Some("Status code yet not supported")); + + // Update meta + meta.replace(Meta { + status: Some(status), + title: Some(title), + }); + + // Update window + action_update.activate(Some(&id)); + } } }, Err((reason, message)) => {