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 @@ ...@@ -34,11 +34,18 @@
--> -->
<template #cell(entries)="data"> <template #cell(entries)="data">
<span <span
v-b-tooltip.html="playlistToolTip(data.value)" :id="`playlist-${data.id}-playable-count`"
class="tw-underline hover:tw-no-underline tw-cursor-help" class="tw-underline hover:tw-no-underline tw-cursor-help"
> >
{{ $t('playlistTable.items', data.value.length) }} {{ $t('playlistTable.items', data.value.length) }}
</span> </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> </template>
<!-- Column: Duration <!-- Column: Duration
...@@ -135,15 +142,6 @@ export default { ...@@ -135,15 +142,6 @@ export default {
}, },
methods: { 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) { deletePlaylist(id) {
// TODO: add mechanism to indicate the running delete request in the files table // TODO: add mechanism to indicate the running delete request in the files table
this.$store.dispatch('playlists/delete', { this.$store.dispatch('playlists/delete', {
......
...@@ -15,9 +15,9 @@ export default { ...@@ -15,9 +15,9 @@ export default {
timeslotsPast: function () { timeslotsPast: function () {
const eps = [] const eps = []
const now = new Date() const now = new Date()
for (const x of this.timeslotsSortedDate) { for (const timeSlot of this.timeslotsSortedDate) {
if (new Date(this.timeslots[x].start) < now) { if (new Date(timeSlot.start) < now) {
eps.push(this.timeslots[x]) eps.push(timeSlot)
} }
} }
return eps return eps
...@@ -25,9 +25,9 @@ export default { ...@@ -25,9 +25,9 @@ export default {
timeslotsFuture: function () { timeslotsFuture: function () {
const eps = [] const eps = []
const now = new Date() const now = new Date()
for (const x of this.timeslotsSortedDate) { for (const timeSlot of this.timeslotsSortedDate) {
if (new Date(this.timeslots[x].start) >= now) { if (new Date(timeSlot.start) >= now) {
eps.push(this.timeslots[x]) eps.push(timeSlot)
} }
} }
return eps return eps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment