Skip to content
Snippets Groups Projects
Commit e4083e66 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: fix iteration bugs

Some iteration semantics got mixed up when replacing remaining uses of
`var` variable declarations in ae37fb6c.

`var foo in bar` cannot be replaced with `const foo of bar` because the
first will assign the iteration index of the current item to foo,
whereas the second will assign the actual iteration item.
parent e417680c
No related branches found
No related tags found
No related merge requests found
Pipeline #3023 passed
......@@ -34,11 +34,18 @@
-->
<template #cell(entries)="data">
<span
v-b-tooltip.html="playlistToolTip(data.value)"
:id="`playlist-${data.id}-playable-count`"
class="tw-underline hover:tw-no-underline tw-cursor-help"
>
{{ $t('playlistTable.items', data.value.length) }}
</span>
<b-tooltip :target="`playlist-${data.id}-playable-count`" triggers="hover">
<div class="text-left whitespace-nowrap">
<template v-for="(playable, index) in data.value" :key="index">
{{ index + 1 }}: {{ playable.uri }}<br />
</template>
</div>
</b-tooltip>
</template>
<!-- Column: Duration
......@@ -135,15 +142,6 @@ export default {
},
methods: {
playlistToolTip(entries) {
let text = '<div style="white-space: nowrap;" align="left">'
for (const i of entries) {
text += i + ': ' + entries[i].uri + '<br>'
}
text += '</div>'
return text
},
deletePlaylist(id) {
// TODO: add mechanism to indicate the running delete request in the files table
this.$store.dispatch('playlists/delete', {
......
......@@ -15,9 +15,9 @@ export default {
timeslotsPast: function () {
const eps = []
const now = new Date()
for (const x of this.timeslotsSortedDate) {
if (new Date(this.timeslots[x].start) < now) {
eps.push(this.timeslots[x])
for (const timeSlot of this.timeslotsSortedDate) {
if (new Date(timeSlot.start) < now) {
eps.push(timeSlot)
}
}
return eps
......@@ -25,9 +25,9 @@ export default {
timeslotsFuture: function () {
const eps = []
const now = new Date()
for (const x of this.timeslotsSortedDate) {
if (new Date(this.timeslots[x].start) >= now) {
eps.push(this.timeslots[x])
for (const timeSlot of this.timeslotsSortedDate) {
if (new Date(timeSlot.start) >= now) {
eps.push(timeSlot)
}
}
return eps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment