Skip to content

Commit d84dd1b

Browse files
memory leak prevention
1 parent 624b14b commit d84dd1b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/pretalx/frontend/schedule-editor/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
.data-row(v-if="editorSession.code && editorSession.speakers && editorSession.speakers.length > 0").form-group.row
4040
label.data-label.col-form-label.col-md-3 {{ $t('Speakers') }}
4141
.col-md-9.data-value
42-
span(v-for="speaker, index of editorSession.speakers")
42+
span(v-for="speaker in editorSession.speakers", :key="speaker.code")
4343
a(:href="`/orga/event/${eventSlug}/speakers/${speaker.code}/`") {{speaker.name}}
44-
span(v-if="index != editorSession.speakers.length - 1") {{', '}}
44+
span(v-if="speaker !== editorSession.speakers[editorSession.speakers.length - 1]") {{', '}}
4545
.data-row(v-else).form-group.row
4646
label.data-label.col-form-label.col-md-3 {{ $t('Title') }}
4747
.col-md-9

src/pretalx/frontend/schedule-editor/src/components/GridSchedule.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:showRoom="false",
2323
@startDragging="startDragging($event)",
2424
)
25-
.availability(v-for="(availability, index) of visibleAvailabilities", :key="index", :style="getSessionStyle(availability)", :class="availability.active ? ['active'] : []")
25+
.availability(v-for="availability of visibleAvailabilities" :key="`avail-${availability.room.id}-${availability.start.valueOf()}`" :style="getSessionStyle(availability)", :class="availability.active ? ['active'] : []")
2626
#hiddenRooms.no-print(v-if="hiddenRooms.length")
2727
h4 {{ $t('Hidden rooms') }} ({{ hiddenRooms.length }})
2828
.room-list
@@ -33,7 +33,7 @@
3333

3434
</template>
3535
<script setup>
36-
import { ref, computed, watch, onMounted, inject, nextTick } from 'vue'
36+
import { ref, computed, watch, onMounted, inject, nextTick, onUnmounted } from 'vue'
3737
import moment from 'moment-timezone'
3838
import Session from './Session'
3939
import { getLocalizedString } from '~/utils'
@@ -348,6 +348,13 @@ onMounted(async () => {
348348
}
349349
})
350350
351+
onUnmounted(() => {
352+
if (observer.value) {
353+
observer.value.disconnect()
354+
}
355+
clearInterval(dragScrollTimer.value)
356+
})
357+
351358
function startDragging({session, event}) {
352359
dragStart.value = {
353360
x: event.clientX,

0 commit comments

Comments
 (0)