Skip to content

Commit 40d0149

Browse files
committed
Displays icon in sources list
1 parent bf49a5f commit 40d0149

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

common/src/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl Model {
4848

4949
let query = format!(
5050
r#"
51-
select source_id, last_error, title, url, user_id, active, webhooks,
51+
select source_id, last_error, title, url, user_id, active, icon, webhooks,
5252
array(select unnest(tags) order by 1) tags
5353
from source
5454
join "user" using (user_id)

front/src/components/source.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ pub(crate) fn Component(props: &Properties) -> yew::Html {
6464

6565
let source = (*source).clone();
6666

67+
let icon = source.icon.clone().unwrap_or_else(|| "/1px.png".to_string());
68+
6769
match *scene {
6870
Scene::Edit => yew::html! {
6971
<super::form::Source {source} {on_cancel} {on_submit} />
@@ -78,7 +80,10 @@ pub(crate) fn Component(props: &Properties) -> yew::Html {
7880
{on_toggle}
7981
/>
8082

81-
{ source.title }
83+
<span>
84+
<img src={ icon } width="16" height="16" class="me-1" />
85+
{ source.title }
86+
</span>
8287

8388
{
8489
if let Some(last_error) = source.last_error {

0 commit comments

Comments
 (0)