about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-01 20:40:20 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-01 20:40:20 +0100
commit3961329955fd837ab7d1f759e52224934c397ced (patch)
tree982ecfcfacb42391ea86740a57b5de0a76509902
parentFrontend: Result component: Use the stylist crate to apply basic css (diff)
downloadOSSE-3961329955fd837ab7d1f759e52224934c397ced.tar.gz
OSSE-3961329955fd837ab7d1f759e52224934c397ced.tar.bz2
OSSE-3961329955fd837ab7d1f759e52224934c397ced.zip
Frontend: Result component: Show "No Description" if empty description
-rw-r--r--frontend/src/app.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/frontend/src/app.rs b/frontend/src/app.rs
index 2389922..b2637ac 100644
--- a/frontend/src/app.rs
+++ b/frontend/src/app.rs
@@ -33,8 +33,11 @@ fn result_component(props: &ResultComponentProps) -> Html {
                 <p class="text-muted">{props.result.url.clone()}</p>
                 <p class="underline-hover">{props.result.title.clone()}</p>
             </a>
-            <p>//No description if no description
-                {props.result.description.clone()}{format!("PRIO: {}", props.result.priority)}
+            <p>
+                {match props.result.description.clone().as_str() {
+                    "" => "No Description.",
+                    otherwise => otherwise,
+                }}{format!("PRIO: {}", props.result.priority)}
             </p>
         </div>
     }