Skip to content

Commit

Permalink
fix label track filter (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
odkhang authored Aug 7, 2024
1 parent 74fd2d7 commit 695e4e1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion webapp/src/views/schedule/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
h1 {{ $t('Tracks')}}
template(v-for="track in schedule.tracks")
div.item(v-if="track")
bunt-checkbox(v-model="tracksFilter[track.id]",name="track_room_views") {{track.name}}
bunt-checkbox(v-model="tracksFilter[track.id]",name="track_room_views") {{ getTrackName(track) }}
</template>
<script>
import { mapState, mapGetters } from 'vuex'
Expand Down Expand Up @@ -93,6 +93,18 @@ export default {
// TODO smooth scroll, seems to not work with chrome {behavior: 'smooth', block: 'center', inline: 'center'}
tabEl?.$el.scrollIntoView()
},
getTrackName(track) {
const language_track = localStorage.userLanguage;
if (typeof track.name === 'object' && track.name !== null) {
if (language_track && track.name[language_track]) {
return track.name[language_track];
} else {
return track.name.en || track.name;
}
} else {
return track.name;
}
},
toggleFavFilter () {
this.tracksFilter = {}
if (this.filter.type === 'fav') {
Expand Down

0 comments on commit 695e4e1

Please sign in to comment.