mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 20:31:36 +00:00
Avoid error: "Cannot read properties of null (reading 'track')"
This commit is contained in:
parent
282203a30a
commit
68d4dac4a2
2 changed files with 16 additions and 4 deletions
|
|
@ -17,9 +17,15 @@ export default {
|
|||
components: {
|
||||
TranscriptionLine
|
||||
},
|
||||
watch: {
|
||||
trackElement() {
|
||||
this.setCues();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cues: [],
|
||||
trackElement: null
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -27,12 +33,17 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
init() {
|
||||
const trackElement = document.getElementById("transcription-track");
|
||||
this.cues = trackElement.track.cues;
|
||||
this.trackElement = document.getElementById("transcription-track")
|
||||
if (this.trackElement && this.trackElement.track) {
|
||||
this.setCues()
|
||||
}
|
||||
},
|
||||
seek(time) {
|
||||
this.$emit('seek', time)
|
||||
},
|
||||
setCues() {
|
||||
this.cues = this.trackElement.track.cues
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue