show dummy icon for radios without logo. fix #13
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Artem Anufrij
2023-09-12 20:10:54 +02:00
parent 7974c8bdca
commit 608e16c827
4 changed files with 91 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div :title="item.name" class="container radio" @click="clicked">
<img class="radioCover shadow" :src="item.cover128" />
<img class="radioCover shadow" :src="cover" />
<p
class="radioTitle"
:class="{ selected: item == $store.state.selectedRadio }"
@@ -30,5 +30,14 @@ export default {
}
},
},
computed: {
cover() {
let res = "/static/icons/dummy/radio.svg";
if (this.item && this.item.cover128) {
res = this.item.cover128;
}
return res;
},
},
};
</script>

View File

@@ -53,7 +53,7 @@
<td>
<img
class="radioCover"
:src="radio.cover32"
:src="cover(radio)"
@click="updateCover(radio)"
/>
</td>
@@ -116,6 +116,13 @@ export default {
updateCover(radio) {
this.$store.dispatch("radios/updateRadio", radio);
},
cover(radio) {
let res = "/static/icons/dummy/radio.svg";
if (radio.cover32) {
res = radio.cover32;
}
return res;
},
},
};
</script>