Skip to content

Commit d204db0

Browse files
fixed working of exports
1 parent c90d136 commit d204db0

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

webapp/src/views/schedule/export-select.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,26 @@ export default {
5252
options: {
5353
type: Array,
5454
required: true
55+
},
56+
modelValue: {
57+
type: Object,
58+
default: null
5559
}
5660
},
5761
emits: ['input', 'update:modelValue'],
5862
data() {
5963
return {
6064
isOpen: false,
61-
selectedOption: null,
65+
selectedOption: this.modelValue ? this.modelValue.label : null,
6266
hoveredOption: null,
6367
qrCodes: {}
6468
}
6569
},
70+
watch: {
71+
modelValue(newVal) {
72+
this.selectedOption = newVal ? newVal.label : null;
73+
}
74+
},
6675
mounted() {
6776
document.addEventListener('click', this.outsideClick)
6877
},
@@ -78,6 +87,7 @@ export default {
7887
selectOption(option) {
7988
this.selectedOption = option.label
8089
this.isOpen = false
90+
this.$emit('update:modelValue', option)
8191
this.$emit('input', option)
8292
},
8393
outsideClick(event) {

webapp/src/views/schedule/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
.export.dropdown
2525
bunt-progress-circular.export-spinner(v-if="isExporting", size="small")
2626
custom-dropdown(name="calendar-add1"
27-
v-model="selectedExporter"
27+
:modelValue="selectedExporter"
28+
@update:modelValue="selectedExporter = $event; makeExport()"
2829
:options="exportType"
29-
label="Add to Calendar"
30-
@input="makeExport")
30+
label="Add to Calendar")
3131

3232
bunt-tabs.days(v-if="days && days.length > 1", :active-tab="currentDay.toISOString()", ref="tabs", v-scrollbar.x="")
3333
bunt-tab(v-for="day in days", :key="day.toISOString()", :id="day.toISOString()", :header="moment(day).format('dddd DD. MMMM')", @selected="changeDay(day)")
@@ -280,6 +280,7 @@ export default {
280280
window.URL.revokeObjectURL(downloadUrl)
281281
a.remove()
282282
this.isExporting = false
283+
this.selectedExporter = null
283284
} catch (error) {
284285
this.isExporting = false
285286
this.error = error

0 commit comments

Comments
 (0)