Skip to content

Commit

Permalink
chore(timeLabel): increased interval, made label work from translations
Browse files Browse the repository at this point in the history
  • Loading branch information
WanderingHogan committed Dec 8, 2021
1 parent 6b00cab commit 4610693
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/tailored/core/media/heading/Heading.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="media-heading">
<UiTag :text="elapsed" />
<UiTag :text="elapsedTimeLabel" />
<div class="spacer"></div>
<transition name="media-fullscreen" mode="out-in">
<div
Expand Down
14 changes: 7 additions & 7 deletions components/tailored/core/media/heading/Heading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export default Vue.extend({
MaximizeIcon,
MinimizeIcon,
},
computed: {
...mapState(['ui', 'webrtc']),
},
data() {
return {
elapsed: `${this.$i18n.t('ui.live')} 00:00`,
elapsedTimeLabel: ''
}
},
computed: {
...mapState(['ui', 'webrtc']),
},
mounted() {
this.$store.commit('ui/fullscreen', false)
this.timer = false
Expand All @@ -38,10 +38,10 @@ export default Vue.extend({
toggleFullscreen() {
this.$store.commit('ui/fullscreen', !this.ui.fullscreen)
},
elapsedTime(start: number): string {
elapsedTime(start: number): void {
const duration = dayjs.duration(Date.now() - start)
const hours = duration.hours()
return `${this.$i18n.t('ui.live')} ${
this.elapsedTimeLabel = `${this.$t('ui.live')} ${
hours > 0 ? `${hours}:` : ''
}${duration.format('mm:ss')}`
},
Expand All @@ -51,7 +51,7 @@ export default Vue.extend({
this.elapsed = this.elapsedTime(this.webrtc.activeStream.createdAt)
this.timerId = setInterval(() => {
this.elapsed = this.elapsedTime(this.webrtc.activeStream.createdAt)
}, 500)
}, 1000)
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion electron
2 changes: 1 addition & 1 deletion locales

0 comments on commit 4610693

Please sign in to comment.