repod/src/App.vue
Michel Roux 544c91edee
All checks were successful
repod / xml (push) Successful in 24s
repod / php (push) Successful in 1m6s
repod / nodejs (push) Successful in 1m8s
repod / release (push) Has been skipped
fix: 🐛 fix loop action
2024-08-15 21:18:20 +02:00

48 lines
1010 B
Vue

<template>
<NcContent app-name="repod">
<GPodder v-if="!gpodder" />
<Subscriptions v-if="gpodder" />
<router-view v-if="gpodder" :key="$route.path" />
<Bar />
</NcContent>
</template>
<script>
import 'toastify-js/src/toastify.css'
import { mapActions, mapState } from 'pinia'
import Bar from './components/Player/Bar.vue'
import GPodder from './views/GPodder.vue'
import { NcContent } from '@nextcloud/vue'
import Subscriptions from './components/Sidebar/Subscriptions.vue'
import { loadState } from '@nextcloud/initial-state'
import { usePlayer } from './store/player.js'
export default {
name: 'App',
components: {
Bar,
GPodder,
NcContent,
Subscriptions,
},
computed: {
...mapState(usePlayer, ['paused']),
gpodder() {
return loadState('repod', 'gpodder', false)
},
},
mounted() {
this.init()
setInterval(this.loop, 40000)
},
methods: {
...mapActions(usePlayer, ['init', 'time']),
loop() {
if (this.paused === false) {
this.time()
}
},
},
}
</script>