Compare commits

..

No commits in common. "7b7ceef5038619f00f323e2c5a901c934fe5a156" and "7c151d8f58bb63b1c0b7c669cb14503d24c77d98" have entirely different histories.

8 changed files with 24 additions and 30 deletions

View File

@ -19,7 +19,7 @@
</template>
<template #actions>
<NcActionButton
v-if="!getSubscriptions.includes(feed.link)"
v-if="!subs.includes(feed.link)"
:aria-label="t('repod', 'Subscribe')"
:name="t('repod', 'Subscribe')"
:title="t('repod', 'Subscribe')"
@ -67,7 +67,7 @@ export default {
loading: false,
}),
computed: {
...mapState(useSubscriptions, ['getSubscriptions']),
...mapState(useSubscriptions, ['subs']),
},
watch: {
value() {

View File

@ -23,7 +23,7 @@
<SafeHtml :source="description" />
</div>
<NcAppNavigationNew
v-if="!getSubscriptions.includes(url)"
v-if="!subs.includes(url)"
:text="t('repod', 'Subscribe')"
@click="addSubscription">
<template #icon>
@ -79,7 +79,7 @@ export default {
},
},
computed: {
...mapState(useSubscriptions, ['getSubscriptions']),
...mapState(useSubscriptions, ['subs']),
url() {
return decodeUrl(this.$route.params.url)
},

View File

@ -53,9 +53,9 @@ export default {
loading: true,
}),
computed: {
...mapState(useSubscriptions, ['getFavorites']),
...mapState(useSubscriptions, ['favs']),
currentFavoriteData() {
return this.getFavorites.find((fav) => fav.url === this.url)
return this.favs.find((fav) => fav.url === this.url)
},
},
async mounted() {

View File

@ -75,9 +75,9 @@ export default {
feed: null,
}),
computed: {
...mapState(useSubscriptions, ['getFavorites']),
...mapState(useSubscriptions, ['favs']),
isFavorite() {
return this.getFavorites.map((fav) => fav.url).includes(this.url)
return this.favs.map((fav) => fav.url).includes(this.url)
},
},
async mounted() {
@ -131,7 +131,7 @@ export default {
},
switchFavorite(value) {
if (value) {
if (this.getFavorites.length >= 10) {
if (this.favs.length >= 10) {
showError(t('repod', 'You can only have 10 favorites'))
return
}

View File

@ -12,13 +12,15 @@
<Loading v-if="loading" />
<NcAppNavigationList v-if="!loading">
<Subscription
v-for="url of getFavorites.map((fav) => fav.url)"
v-for="url of favs
.sort((fav) => fav.lastPub)
.map((fav) => fav.url)
.filter((url) => subs.includes(url))"
:key="url"
:url="url" />
<Subscription
v-for="url of getSubscriptions.filter(
(sub) =>
!getFavorites.map((fav) => fav.url).includes(sub),
v-for="url of subs.filter(
(sub) => !favs.map((fav) => fav.url).includes(sub),
)"
:key="url"
:url="url" />
@ -62,7 +64,7 @@ export default {
loading: true,
}),
computed: {
...mapState(useSubscriptions, ['getSubscriptions', 'getFavorites']),
...mapState(useSubscriptions, ['subs', 'favs']),
},
async mounted() {
try {

View File

@ -44,11 +44,11 @@ export const usePlayer = defineStore('player', {
}),
)
this.episode.action = action.data
this.episode.action = action
} catch {}
if (
this.episode.action &&
this.episode.action?.position &&
this.episode.action.position < this.episode.action.total
) {
audio.currentTime = this.episode.action.position

View File

@ -8,16 +8,6 @@ export const useSubscriptions = defineStore('subscriptions', {
subs: [],
favs: [],
}),
getters: {
getSubscriptions: (state) => {
return state.subs
},
getFavorites: (state) => {
return state.favs
.filter((fav) => state.subs.includes(fav.url))
.sort((fav) => fav.lastPub)
},
},
actions: {
async fetch() {
const metrics = await axios.get(

View File

@ -1,7 +1,7 @@
<template>
<AppContent>
<EmptyContent
v-if="!getFavorites.length"
v-if="!favs.length"
class="empty"
:description="
t('repod', 'Pin some subscriptions to see their latest updates')
@ -11,8 +11,10 @@
<StarOffIcon :size="20" />
</template>
</EmptyContent>
<ul v-if="getFavorites.length">
<li v-for="url in getFavorites.map((fav) => fav.url)" :key="url">
<ul v-if="favs.length">
<li
v-for="url in favs.sort((fav) => fav.lastPub).map((fav) => fav.url)"
:key="url">
<Favorites :url="url" />
</li>
</ul>
@ -36,7 +38,7 @@ export default {
StarOffIcon,
},
computed: {
...mapState(useSubscriptions, ['getFavorites']),
...mapState(useSubscriptions, ['favs']),
},
}
</script>