Commit 4844d5f9 authored by Anton's avatar Anton
Browse files

Prevent exceptions on media/edit page when selector value is no DateTime object

parent dc6ae0b9
Pipeline #76572 passed with stage
in 3 minutes and 15 seconds
......@@ -10,7 +10,10 @@ and this project adheres to
## [Unreleased]
No changes.
### Fixed
- `media/edit` page breaks when single ISO timestamp
is returned for selectorValue
## [2.3.0] - 2020-08-17
......
......@@ -8,10 +8,10 @@
.q-mb-lg
q-alert(color="info" :actions="actions" v-if="showDurationOverride") {{ $t('routes.piecemaker.media.edit.duration_found') }}
content-paragraph(v-if="acl.put", :position="'first'")
content-paragraph(v-if="selectorValue && acl.put", :position="'first'")
calendar-time-main(:datetime="selectorValue", @update="onCalendarUpdate")
content-paragraph(v-if="acl.put")
content-paragraph(v-if="selectorValue && acl.put")
// p.q-mt-md {{ $t('labels.media_duration') }}: {{ duration }}
p(v-if="selectorOverride !== selectorValue") {{ $t('messages.caution_media_time_override') }}
......@@ -102,7 +102,10 @@
selectorValue () {
if (this.annotation) {
const parsed = this.annotation.target.selector.parse()
return Array.isArray(parsed['date-time:t']) ? parsed['date-time:t'][0].toISO() : parsed['date-time:t'].toISO()
const value = Array.isArray(parsed['date-time:t'])
? parsed['date-time:t'].shift() : parsed['date-time:t']
if (value && typeof value.toISO === 'function') return value.toISO()
return value
}
},
duration () {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment