diff --git a/src/components/Main.vue b/src/components/Main.vue index 43897cf..1ee7abf 100644 --- a/src/components/Main.vue +++ b/src/components/Main.vue @@ -11,6 +11,7 @@ { + this.favorites.push(station.stationuuid) + }) + } catch (error) { showError(t('radio', 'Could not favor station')) } }, @@ -211,9 +216,14 @@ export default { this.$store.dispatch('getVolumeState') }, async loadFavorites() { + const vm = this await axios.get(generateUrl('/apps/radio/api/favorites')) .then(function(response) { - this.favorites = response.data + const favorites = [] + for (let i = 0, len = response.data.length; i < len; i++) { + favorites.push(response.data[i].stationuuid) + } + vm.favorites = favorites }) }, }, diff --git a/src/components/Table.vue b/src/components/Table.vue index 9beff0e..ab2438a 100644 --- a/src/components/Table.vue +++ b/src/components/Table.vue @@ -21,7 +21,7 @@ height="32" :hash="station.blurHash" :src="station.favicon" /> - +
@@ -54,6 +54,10 @@ export default { ActionButton, }, props: { + favorites: { + type: Array, + default() { return [] }, + }, stationData: { type: Array, default() { return [] }, @@ -61,7 +65,6 @@ export default { }, data: () => ({ activeItem: null, - stationsFavored: [1, 2, 3, 4], }), methods: { doPlay(idx, station) {